/*
 * Shared stylesheet for the myMat marketing site (MM-161).
 *
 * Extracted verbatim from index.html's inline <style> block: design tokens,
 * reset, typography, container, nav, buttons, section utilities, and footer.
 * The four original pages still carry their own inline copies of these rules
 * and are NOT yet pointed at this file — that is a follow-up ticket. Until
 * then this file serves the blog and changelog only, so any change made here
 * must be mirrored in those pages or the site will drift.
 *
 * Blog- and changelog-specific rules live at the bottom, under "Editorial".
 */

/* ── Icons (MM-144) ──
   Inline SVG sprite replacing the FontAwesome CDN bundle. Sized in em and
   filled with currentColor so icons inherit font-size and color exactly the
   way the icon font did. */
.icon {
  width: 1em;
  height: 1em;
  fill: currentColor;
  flex: none;
  vertical-align: -0.125em;
}

/* Self-hosted variable fonts (MM-144). Replaces the render-blocking
   Google Fonts stylesheet: no third-party connection, no FOIT.
   latin-ext is only fetched when a glyph outside latin is used. */
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/dm-sans-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/dm-sans-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/playfair-display-italic-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/fonts/playfair-display-italic-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/playfair-display-normal-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/playfair-display-normal-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ob-surface: #f9f8f6;
  --ob-surface-alt: #f3f1ed;
  --ob-white: #ffffff;
  --ob-text: #2d2d2d;
  --ob-text-muted: #6b6560;
  --ob-text-faint: #9b9590;
  --ob-border: #e0ddd8;
  --ob-border-focus: #2d2d2d;
  --ob-accent: #2d2d2d;
  --ob-accent-hover: #1a1a1a;
  --ob-heading-font: 'Playfair Display', Georgia, serif;
  --ob-body-font: 'DM Sans', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ob-body-font);
  color: var(--ob-text);
  background: var(--ob-surface);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--ob-text); }
img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--ob-heading-font);
  font-weight: 700;
  color: var(--ob-text);
  line-height: 1.15;
  margin: 0;
  letter-spacing: -0.01em;
}

.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 24px; }
.container-narrow { width: 100%; max-width: 820px; margin: 0 auto; padding: 0 24px; }

.visually-hidden-focusable { position: absolute; left: -9999px; }
.visually-hidden-focusable:focus { position: static; left: auto; color: var(--ob-accent); padding: 8px; }

/* ── Nav ── */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(249,248,246,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ob-border);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 0;
  gap: 24px;
}
.nav-logo img { height: 28px; width: auto; }
.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-link {
  color: var(--ob-text);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color .2s ease;
}
.nav-link:hover { color: var(--ob-text-muted); }
.nav-cta { display: flex; gap: 8px; align-items: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--ob-body-font);
  font-size: 0.9375rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: 10px;
  padding: 10px 22px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 200ms ease, color 200ms ease, transform 200ms ease, border-color 200ms ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ob-accent);
  color: var(--ob-white);
}
.btn-primary:hover { background: var(--ob-accent-hover); transform: translateY(-1px); color: var(--ob-white); }
.btn-ghost {
  background: transparent;
  color: var(--ob-text);
  border-color: var(--ob-border);
}
.btn-ghost:hover { background: var(--ob-white); border-color: var(--ob-text); }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

@media (max-width: 820px) {
  .nav-links { display: none; }
}

/* ── Sections ── */
.section { padding: 96px 0; }
.section-alt { background: var(--ob-surface-alt); }
.section-header { text-align: center; margin-bottom: 64px; }
.section-eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ob-text-muted);
  margin-bottom: 16px;
}
.section-header h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  max-width: 20ch;
  margin: 0 auto 16px;
}
.section-header p {
  font-size: 1.0625rem;
  color: var(--ob-text-muted);
  max-width: 60ch;
  margin: 0 auto;
}

/* ── Footer ── */
footer {
  background: var(--ob-surface-alt);
  border-top: 1px solid var(--ob-border);
  padding: 64px 0 32px;
  color: var(--ob-text-muted);
  font-size: 0.9375rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 48px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand img { height: 26px; width: auto; margin-bottom: 12px; }
.footer-brand p { margin: 0; max-width: 28ch; font-size: 0.9375rem; }
.footer-col h3 {
  font-family: var(--ob-body-font);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ob-text);
  margin-bottom: 14px;
}
.footer-col a {
  display: block;
  color: var(--ob-text-muted);
  text-decoration: none;
  font-size: 0.9375rem;
  padding: 4px 0;
  transition: color .2s ease;
}
.footer-col a:hover { color: var(--ob-text); }
.footer-bottom {
  border-top: 1px solid var(--ob-border);
  padding-top: 24px;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
  font-size: 0.8125rem;
  color: var(--ob-text-faint);
}
.footer-bottom a { color: var(--ob-text-muted); }
.socials { display: flex; gap: 16px; list-style: none; padding: 0; margin: 0; }
.socials a {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--ob-border);
  border-radius: 50%;
  color: var(--ob-text-muted);
  transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.socials a:hover { background: var(--ob-accent); color: var(--ob-surface); border-color: var(--ob-accent); }

/* Divider */
.divider {
  height: 1px; background: var(--ob-border);
  max-width: 120px; margin: 0 auto;
}

/* ── Editorial: blog and changelog (MM-161) ──
   Only these pages use this stylesheet today. Rules here are additive and
   reuse the tokens above, so nothing needs mirroring into the original pages. */

.editorial { padding: 64px 0 96px; }
.editorial-header { margin-bottom: 56px; }
.editorial-header h1 { font-size: clamp(2rem, 5vw, 3rem); margin-bottom: 12px; }
.editorial-header p { color: var(--ob-text-muted); margin: 0; font-size: 1.0625rem; }

.editorial-empty {
  border: 1px dashed var(--ob-border);
  border-radius: 10px;
  padding: 48px 24px;
  text-align: center;
  color: var(--ob-text-muted);
}

/* Post listing */
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.post-list-item { border-bottom: 1px solid var(--ob-border); }
.post-list-item:last-child { border-bottom: 0; }
.post-list-link {
  display: block;
  text-decoration: none;
  padding: 28px 0;
  transition: opacity .2s ease;
}
.post-list-link:hover { opacity: .72; }
.post-list-link h2 { font-size: 1.5rem; margin-bottom: 8px; }
.post-list-link p { color: var(--ob-text-muted); margin: 0 0 10px; }

.post-meta {
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ob-text-faint);
}

/* Single post */
.post-header { margin-bottom: 40px; }
.post-header h1 { font-size: clamp(2rem, 5vw, 2.75rem); margin: 12px 0 16px; }
.post-header .post-lede { color: var(--ob-text-muted); font-size: 1.125rem; margin: 0; }
.post-hero { border-radius: 10px; margin-bottom: 40px; }

.post-body { font-size: 1.0625rem; }
.post-body > * + * { margin-top: 1.4em; }
.post-body h2 { font-size: 1.625rem; margin-top: 2em; }
.post-body h3 { font-size: 1.25rem; margin-top: 1.8em; }
.post-body ul, .post-body ol { padding-left: 1.25em; }
.post-body li + li { margin-top: 0.5em; }
.post-body img { border-radius: 10px; }
.post-body a { color: var(--ob-text); text-underline-offset: 3px; }
.post-body blockquote {
  margin-left: 0; margin-right: 0;
  padding: 4px 0 4px 20px;
  border-left: 2px solid var(--ob-border);
  color: var(--ob-text-muted);
  font-family: var(--ob-heading-font);
  font-style: italic;
  font-size: 1.125rem;
}
.post-body code {
  background: var(--ob-surface-alt);
  border: 1px solid var(--ob-border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 0.9em;
}
.post-body pre {
  background: var(--ob-surface-alt);
  border: 1px solid var(--ob-border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}
.post-body pre code { background: none; border: 0; padding: 0; }

.post-footer {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--ob-border);
}

/* Changelog */
.changelog-list { list-style: none; padding: 0; margin: 0; }
.changelog-entry { padding: 32px 0; border-bottom: 1px solid var(--ob-border); }
.changelog-entry:last-child { border-bottom: 0; }
.changelog-entry h2 { font-size: 1.375rem; margin: 10px 0 12px; }
.changelog-entry-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.changelog-body > * + * { margin-top: 1em; }
.changelog-body ul { padding-left: 1.25em; margin: 0; }

.changelog-type {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--ob-border);
  background: var(--ob-white);
  color: var(--ob-text-muted);
}
.changelog-type-added { border-color: var(--ob-accent); color: var(--ob-accent); }
.changelog-type-improved { background: var(--ob-surface-alt); }
.changelog-type-fixed { border-style: dashed; }

.changelog-version {
  font-size: 0.8125rem;
  color: var(--ob-text-faint);
  font-variant-numeric: tabular-nums;
}

/* Roadmap */
.roadmap-columns { display: grid; gap: 40px; grid-template-columns: 1fr; }

/* Three abreast only once each column can hold a feature name without
   wrapping mid-word; below that they stack and the headings do the separating. */
@media (min-width: 860px) {
  .roadmap-columns { grid-template-columns: repeat(3, 1fr); gap: 44px; }
}

/* Deliberately not the heading serif. These are parallel column labels rather
   than a hierarchy of headings, so they take the same uppercase-label
   treatment as .post-meta and .changelog-type. */
.roadmap-column-title {
  font-family: var(--ob-body-font);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ob-text-muted);
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ob-border);
}

.roadmap-list { list-style: none; padding: 0; margin: 0; }
.roadmap-item { padding: 22px 0; border-bottom: 1px solid var(--ob-border); }
.roadmap-item:last-child { border-bottom: 0; }
.roadmap-item-name { font-size: 1.125rem; margin: 0 0 8px; }
.roadmap-item-body { color: var(--ob-text-muted); font-size: 0.9375rem; }
.roadmap-item-body > * { margin: 0; }
.roadmap-item-body > * + * { margin-top: 0.75em; }
.roadmap-item-body ul { padding-left: 1.25em; }

.roadmap-column-empty {
  color: var(--ob-text-faint);
  font-size: 0.9375rem;
  padding: 22px 0;
  margin: 0;
}
