/* Mirny ESMS public site — landing page styles
   Color palette: EARTH/OCHRE/SAGE matched to dashboard
   Print-friendly, mobile-responsive */

:root {
  --earth: #1C3A2E;
  --earth-dark: #14271F;
  --earth-pale: #F5F1E8;
  --ochre: #B8871E;
  --ochre-pale: #F2E4BA;
  --sage: #647A57;
  --sage-pale: #DCE5D4;
  --critical: #8B1A1A;
  --critical-pale: #F5DEDE;
  --steppe-sand: #E8DEC8;
  --ink: #1A1814;
  --ink-muted: #5C5C56;
  --bg: #FAFAF7;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; -webkit-font-smoothing: antialiased; }

a { color: var(--earth); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }

h1, h2, h3, h4 { font-family: 'Source Serif Pro', Georgia, serif; color: var(--earth); line-height: 1.2; }
h1 { font-size: clamp(28px, 4.5vw, 48px); font-weight: 700; }
h2 { font-size: clamp(22px, 3.2vw, 32px); font-weight: 700; margin-bottom: 18px; }
h3 { font-size: 20px; font-weight: 700; margin-bottom: 12px; }
h4 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }

p { margin-bottom: 12px; }
.lede { font-size: 16px; color: var(--ink-muted); margin-bottom: 24px; max-width: 820px; }

/* ============ HEADER ============ */
.site-header { background: #fff; border-bottom: 1px solid var(--steppe-sand); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 8px rgba(0,0,0,0.04); }
.site-header .wrap { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; padding-bottom: 16px; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { width: 44px; height: 44px; background: var(--earth); color: #fff; display: flex; align-items: center; justify-content: center; font-family: 'Source Serif Pro', serif; font-size: 22px; font-weight: 700; border-radius: 6px; flex-shrink: 0; }
.brand-title { font-family: 'Source Serif Pro', serif; font-weight: 700; font-size: 20px; color: var(--earth); }
.brand-sub { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.site-nav { display: flex; gap: 26px; }
.site-nav a { color: var(--ink); font-weight: 500; font-size: 14px; padding: 6px 0; border-bottom: 2px solid transparent; transition: border-color 0.15s; }
.site-nav a:hover { border-color: var(--earth); text-decoration: none; }

/* ============ HERO ============ */
.hero { position: relative; min-height: 480px; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; transform: scale(1.04); }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(135deg, rgba(20,39,31,0.92) 0%, rgba(28,58,46,0.78) 50%, rgba(28,58,46,0.55) 100%); }
.hero-content { position: relative; z-index: 1; color: #fff; padding: 80px 24px; max-width: 980px; }
.hero h1 { color: #fff; margin-bottom: 18px; }
.hero-eyebrow { display: inline-block; padding: 6px 14px; background: var(--ochre); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border-radius: 4px; margin-bottom: 20px; }
.hero-lede { font-size: 18px; line-height: 1.55; max-width: 720px; margin-bottom: 28px; opacity: 0.94; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.btn { display: inline-flex; align-items: center; padding: 14px 28px; border-radius: 6px; font-weight: 600; font-size: 15px; transition: transform 0.1s, box-shadow 0.15s; cursor: pointer; border: 0; }
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--ochre); color: #fff; box-shadow: 0 4px 12px rgba(184,135,30,0.3); }
.btn-primary:hover { background: #a07918; box-shadow: 0 6px 16px rgba(184,135,30,0.4); }
.btn-ghost { background: rgba(255,255,255,0.12); color: #fff; border: 1px solid rgba(255,255,255,0.4); backdrop-filter: blur(4px); }
.btn-ghost:hover { background: rgba(255,255,255,0.22); }

/* ============ STATS ============ */
.stats { background: #fff; padding: 48px 0; border-bottom: 1px solid var(--steppe-sand); }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 18px; }
.stat { padding: 18px 16px; text-align: center; border-left: 3px solid var(--sage); background: var(--earth-pale); border-radius: 4px; }
.stat.highlight { border-left-color: var(--ochre); background: var(--ochre-pale); }
.stat .num { font-family: 'Source Serif Pro', serif; font-size: 36px; font-weight: 700; color: var(--earth); line-height: 1; }
.stat .num .sub { font-size: 22px; color: var(--ink-muted); }
.stat .lbl { font-size: 11px; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 8px; line-height: 1.3; }

/* ============ TILES ============ */
.tiles { padding: 64px 0; }
.tiles + .tiles { padding-top: 0; }
.tile-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 20px; margin-top: 24px; }
.tile-grid.four { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .tile-grid, .tile-grid.four { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .tile-grid, .tile-grid.four { grid-template-columns: 1fr; } }

.tile { background: #fff; border: 1px solid var(--steppe-sand); border-radius: 8px; overflow: hidden; transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s; display: flex; flex-direction: column; color: var(--ink); }
.tile:hover { transform: translateY(-3px); box-shadow: 0 12px 30px rgba(0,0,0,0.08); border-color: var(--earth); text-decoration: none; }
.tile-img { width: 100%; height: 180px; background-size: cover; background-position: center; background-color: var(--earth); }
.tile-img.short { height: 120px; }
.tile-body { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; }
.tile-tag { font-size: 10px; font-weight: 700; color: var(--ochre); letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px; }
.tile h3 { color: var(--earth); margin-bottom: 8px; }
.tile p { font-size: 13.5px; color: var(--ink-muted); line-height: 1.5; flex: 1; }
.tile.compact .tile-body { padding: 12px 14px 14px; }
.tile.compact h3 { font-size: 16px; }
.tile.compact p { font-size: 12px; }
.tile-cta { color: var(--earth); font-weight: 600; font-size: 14px; margin-top: 10px; }

.tile.tile-primary { border: 2px solid var(--ochre); background: linear-gradient(135deg, #fff 0%, var(--ochre-pale) 100%); }
.tile.tile-primary .tile-tag { color: var(--earth); }
.tile.tile-primary .tile-cta { color: var(--ochre); }

/* ============ DOWNLOADS ============ */
.downloads { padding: 64px 0; background: var(--earth-pale); }
.dl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.dl-card { background: #fff; border: 1px solid var(--steppe-sand); border-radius: 8px; padding: 0; display: flex; align-items: stretch; transition: transform 0.15s, box-shadow 0.15s; color: var(--ink); }
.dl-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); text-decoration: none; }
.dl-icon { background: var(--earth); color: #fff; padding: 24px 18px; font-family: 'JetBrains Mono', monospace; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; border-radius: 8px 0 0 8px; min-width: 90px; }
.dl-body { padding: 20px 22px; flex: 1; }
.dl-body h4 { color: var(--earth); margin-bottom: 6px; }
.dl-body p { font-size: 13px; color: var(--ink-muted); margin-bottom: 8px; }
.dl-cta { color: var(--ochre); font-weight: 600; font-size: 13px; }

/* ============ ABOUT ============ */
.about { padding: 64px 0; background: #fff; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; margin-bottom: 36px; }
@media (max-width: 768px) { .about-grid { grid-template-columns: 1fr; gap: 28px; } }
.kv { list-style: none; }
.kv li { padding: 10px 0; border-bottom: 1px solid var(--steppe-sand); display: flex; gap: 16px; font-size: 14px; }
.kv .k { color: var(--ink-muted); min-width: 220px; flex-shrink: 0; }
.kv .v { color: var(--ink); }
.footer-strip { background: var(--sage-pale); border-left: 4px solid var(--sage); padding: 18px 22px; border-radius: 4px; font-size: 14px; color: var(--ink); }
.footer-strip > div + div { margin-top: 8px; }

/* ============ FOOTER ============ */
.site-footer { background: var(--earth-dark); color: rgba(255,255,255,0.85); padding: 32px 0; }
.footer-cols { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-title { font-family: 'Source Serif Pro', serif; font-size: 18px; font-weight: 700; color: #fff; }
.footer-sub { font-size: 13px; color: rgba(255,255,255,0.65); margin-top: 4px; }
.footer-meta { font-size: 12px; color: rgba(255,255,255,0.65); text-align: right; }
.footer-meta div { margin-bottom: 4px; }
.footer-meta a { color: var(--ochre-pale); }
@media (max-width: 640px) { .footer-meta { text-align: left; } }

/* ============ MOBILE ============ */
@media (max-width: 640px) {
  .site-nav { width: 100%; gap: 18px; }
  .site-nav a { font-size: 13px; }
  .hero-content { padding: 56px 20px; }
  .hero-lede { font-size: 16px; }
  .stats { padding: 32px 0; }
  .tiles, .downloads, .about { padding: 40px 0; }
  .stat .num { font-size: 28px; }
  .kv li { flex-direction: column; gap: 4px; }
  .kv .k { min-width: auto; }
}

@media print { .site-header, .site-nav, .site-footer { display: none; } .hero { min-height: auto; } }
