/* =============================================================
   HMK Mining — Design System
   Mobile-first, iOS / Safari optimized
   ============================================================= */

/* ---------- Tokens ---------- */
:root {
  /* HMK Brand */
  --hmk-red: #B0252A;
  --hmk-red-deep: #8C1D22;
  --hmk-red-soft: #E0696D;
  --hmk-red-bg: #FBEFEF;

  /* Neutrals */
  --ink: #14171A;
  --ink-2: #2A2F36;
  --muted: #5C636E;
  --line: #E5E7EB;
  --line-soft: #F1F2F4;
  --bg: #FFFFFF;
  --bg-soft: #F7F8FA;
  --bg-deep: #0E1013;

  /* Functional */
  --gold: #C9A24A;
  --silver: #9FA6AD;
  --copper: #C36A2D;
  --lithium: #6FA8DC;
  --tungsten: #4B6075;
  --antimony: #6F4F8E;
  --ree: #2E7D6B;

  /* Type scale */
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
               "Helvetica Neue", "Segoe UI", Roboto, system-ui, sans-serif;
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  /* Layout */
  --maxw: 1200px;
  --gutter: 20px;
  --radius-sm: 6px;
  --radius: 12px;
  --radius-lg: 20px;

  /* Motion */
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent;
}
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; border: 0; background: none; cursor: pointer; color: inherit; }
input, textarea, select {
  font: inherit;
  font-size: 16px; /* prevents iOS zoom on focus */
  color: inherit;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}
section { padding: 64px 0; }
@media (min-width: 768px) { section { padding: 96px 0; } }

/* ---------- Type ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
  font-weight: 700;
  color: var(--ink);
}
h1 {
  font-size: clamp(2.1rem, 6.4vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}
h2 {
  font-size: clamp(1.6rem, 4.4vw, 2.6rem);
  line-height: 1.1;
}
h3 { font-size: 1.25rem; line-height: 1.25; }
h4 { font-size: 1rem; line-height: 1.3; text-transform: uppercase; letter-spacing: 0.08em; }
p  { margin: 0 0 1em; color: var(--ink-2); }
.lead { font-size: 1.15rem; color: var(--ink-2); line-height: 1.55; }
em.accent, .accent { color: var(--hmk-red); font-style: italic; font-weight: 700; }
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--hmk-red);
  margin-bottom: 16px;
}
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 14px 22px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease), color 0.18s var(--ease);
  white-space: nowrap;
  border: 1.5px solid transparent;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--hmk-red); color: #fff; }
.btn-primary:hover { background: var(--hmk-red-deep); }
.btn-ghost { border-color: var(--ink); color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-light { border-color: rgba(255,255,255,0.5); color: #fff; }
.btn-light:hover { background: #fff; color: var(--ink); }
.btn-sm { min-height: 40px; padding: 10px 16px; font-size: 14px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 36px; height: 36px;
  background: var(--hmk-red);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.04em;
}
.brand-name {
  font-weight: 800;
  font-size: 17px;
  letter-spacing: 0.02em;
  color: var(--ink);
}
.brand-name span { color: var(--hmk-red); }

.nav-links {
  display: none;
  gap: 28px;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  position: relative;
  padding: 6px 0;
}
.nav-links a:hover, .nav-links a.is-active { color: var(--hmk-red); }
.nav-links a.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px; background: var(--hmk-red); border-radius: 2px;
}
.nav-cta { display: none; }

.nav-toggle {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (min-width: 900px) {
  .nav-links, .nav-cta { display: flex; }
  .nav-toggle { display: none; }
}

/* Mobile menu drawer */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 60;
  transform: translateX(100%);
  transition: transform 0.32s var(--ease);
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top) + 24px) 24px calc(env(safe-area-inset-bottom) + 24px);
}
.mobile-menu.is-open { transform: translateX(0); }
.mobile-menu-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 32px;
}
.mobile-menu-list { list-style: none; padding: 0; margin: 0; }
.mobile-menu-list li { border-bottom: 1px solid var(--line); }
.mobile-menu-list a {
  display: block;
  padding: 18px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.mobile-menu-list a.is-active { color: var(--hmk-red); }
.mobile-menu-foot { margin-top: auto; padding-top: 24px; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: var(--bg);
  padding: 56px 0 24px;
  overflow: hidden;
}
@media (min-width: 768px) {
  .hero { padding: 96px 0 56px; }
}
.hero-grid {
  display: grid;
  gap: 36px;
}
@media (min-width: 900px) {
  .hero-grid { grid-template-columns: 1.05fr 1fr; align-items: center; gap: 56px; }
}
.hero-pretitle {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--hmk-red-bg);
  color: var(--hmk-red-deep);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 22px;
}
.hero-pretitle .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--hmk-red); display: inline-block; }
.hero h1 strong { color: var(--hmk-red); font-weight: 700; }
.hero p.lead { margin-top: 18px; max-width: 560px; }
.hero-actions { margin-top: 28px; }
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 16px;
  margin-top: 36px;
  max-width: 560px;
}
.hero-stat {
  border-top: 2px solid var(--hmk-red);
  padding-top: 12px;
}
.hero-stat strong {
  display: block;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.hero-stat span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
  text-transform: uppercase;
}

.hero-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-soft);
  aspect-ratio: 4/3;
  border: 1px solid var(--line);
}
.hero-visual::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.5));
}
.hero-visual .badge {
  position: absolute;
  bottom: 18px; left: 18px;
  z-index: 2;
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}

/* ---------- Section heading ---------- */
.section-head { max-width: 760px; margin-bottom: 40px; }
.section-head .lead { color: var(--muted); }

/* ---------- Cards ---------- */
.cards {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--hmk-red-soft);
  box-shadow: 0 12px 30px -16px rgba(176,37,42,0.18);
}
.card-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--hmk-red-bg);
  color: var(--hmk-red);
  display: inline-flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.card h3 { margin-bottom: 8px; }
.card p { color: var(--muted); font-size: 15px; line-height: 1.55; margin: 0; }

/* ---------- Feature row (alternating) ---------- */
.feature {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
  align-items: center;
  margin-bottom: 56px;
}
@media (min-width: 900px) {
  .feature { grid-template-columns: 1fr 1fr; gap: 64px; }
  .feature.reverse > :first-child { order: 2; }
}
.feature-img {
  border-radius: var(--radius-lg);
  background: var(--bg-soft);
  aspect-ratio: 5/4;
  border: 1px solid var(--line);
  overflow: hidden;
}

/* ---------- Stats strip ---------- */
.stats-strip {
  background: var(--ink);
  color: #fff;
  padding: 56px 0;
}
.stats-strip h2 { color: #fff; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-top: 32px;
}
@media (min-width: 760px) { .stats-grid { grid-template-columns: repeat(4, 1fr); } }
.stats-grid .stat {
  border-top: 2px solid var(--hmk-red);
  padding-top: 14px;
}
.stats-grid .stat strong {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.stats-grid .stat span {
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.65);
  text-transform: uppercase;
}

/* ---------- Project tiles ---------- */
.project-tile {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  transition: transform 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: block;
  color: inherit;
}
.project-tile:hover {
  transform: translateY(-2px);
  border-color: var(--hmk-red-soft);
  box-shadow: 0 14px 30px -16px rgba(20,23,26,0.16);
}
.project-tile::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: var(--hmk-red);
  opacity: 0; transition: opacity 0.2s var(--ease);
}
.project-tile:hover::before { opacity: 1; }
.project-tile-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px;
}
.project-tile h3 { font-size: 18px; margin: 0; }
.region-badge {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--muted);
}
.commodity-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.commodity-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--ink-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 5px;
}
.commodity-pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 999px; background: var(--ink);
}
.commodity-pill.au::before { background: var(--gold); }
.commodity-pill.ag::before { background: var(--silver); }
.commodity-pill.cu::before { background: var(--copper); }
.commodity-pill.li::before { background: var(--lithium); }
.commodity-pill.w::before  { background: var(--tungsten); }
.commodity-pill.sb::before { background: var(--antimony); }
.commodity-pill.ree::before{ background: var(--ree); }
.project-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 13px; color: var(--muted);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.project-meta b { color: var(--ink); font-weight: 700; }

/* ---------- News list ---------- */
.news-list { display: grid; gap: 16px; }
.news-item {
  display: grid;
  gap: 6px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.news-item:hover { border-color: var(--hmk-red-soft); transform: translateY(-2px); }
.news-date { font-size: 12px; font-weight: 700; color: var(--hmk-red); letter-spacing: 0.06em; text-transform: uppercase; }
.news-title { font-size: 17px; font-weight: 700; color: var(--ink); margin: 0; line-height: 1.35; }
.news-excerpt { font-size: 14px; color: var(--muted); margin: 6px 0 0; }

/* ---------- Filter bar ---------- */
.filterbar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px;
  margin: 0 -4px 20px;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.filterbar::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  scroll-snap-align: start;
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px;
  white-space: nowrap;
}
.chip:hover { border-color: var(--hmk-red-soft); color: var(--hmk-red); }
.chip.is-active { background: var(--hmk-red); border-color: var(--hmk-red); color: #fff; }
.chip .count { font-size: 11px; opacity: 0.7; }

/* ---------- Map ---------- */
.map-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  height: 60vh;
  min-height: 420px;
}
@media (min-width: 900px) { .map-wrap { height: 72vh; } }
#map { width: 100%; height: 100%; }
.leaflet-container { font-family: var(--font-sans) !important; }
.map-pin {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--hmk-red);
  border: 3px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 11px; font-weight: 800;
}
.map-popup { font-family: var(--font-sans); }
.map-popup h4 { margin: 0 0 4px; font-size: 14px; text-transform: none; letter-spacing: 0; }
.map-popup .meta { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.leaflet-popup-content-wrapper { border-radius: 10px !important; }
.leaflet-popup-content { margin: 12px 14px !important; }

/* Map legend */
.map-legend {
  position: absolute;
  left: 12px; bottom: 12px;
  z-index: 400;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 11.5px;
  display: grid;
  grid-template-columns: repeat(2, auto);
  gap: 4px 12px;
}
.map-legend .swatch {
  display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; vertical-align: middle;
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--hmk-red);
  color: #fff;
  padding: 56px 0;
}
.cta-banner h2 { color: #fff; }
.cta-banner p { color: rgba(255,255,255,0.92); }

/* ---------- Forms ---------- */
.form-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr;
  max-width: 640px;
}
@media (min-width: 700px) { .form-grid { grid-template-columns: 1fr 1fr; } }
.form-grid .full { grid-column: 1 / -1; }
.field { display: grid; gap: 6px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink); letter-spacing: 0.02em; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px 14px;
  background: #fff;
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
  width: 100%;
  min-height: 48px;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--hmk-red);
  box-shadow: 0 0 0 3px rgba(176,37,42,0.18);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--bg-deep);
  color: rgba(255,255,255,0.78);
  padding: 64px 0 32px;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}
.footer-grid {
  display: grid;
  gap: 32px;
  grid-template-columns: 1fr;
  margin-bottom: 36px;
}
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { color: rgba(255,255,255,0.65); font-size: 14px; max-width: 360px; }
.footer-grid h4 { color: #fff; margin-bottom: 14px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: 8px; font-size: 14.5px; }
.footer-grid a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.55);
}

/* ---------- Project detail page ---------- */
.project-hero {
  background: var(--bg-soft);
  padding: 36px 0 24px;
  border-bottom: 1px solid var(--line);
}
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--hmk-red); }
.project-overview {
  display: grid;
  gap: 28px;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .project-overview { grid-template-columns: 1.4fr 1fr; gap: 56px; }
}
.fact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 24px;
}
.fact {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background: #fff;
}
.fact .label { font-size: 11px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; font-weight: 700; }
.fact .value { font-size: 16px; font-weight: 700; margin-top: 4px; color: var(--ink); }

/* ---------- Utilities ---------- */
.bg-soft { background: var(--bg-soft); }
.bg-dark { background: var(--bg-deep); color: #fff; }
.bg-dark h1, .bg-dark h2, .bg-dark h3, .bg-dark h4 { color: #fff; }
.bg-dark p, .bg-dark .lead { color: rgba(255,255,255,0.78); }
.center { text-align: center; }
.divider { height: 1px; background: var(--line); margin: 48px 0; border: 0; }
.hide-mobile { display: none; }
@media (min-width: 760px) { .hide-mobile { display: initial; } .hide-desktop { display: none; } }

/* Anchor offset for sticky header */
[id] { scroll-margin-top: 80px; }

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
