/* ==========================================================================
   MINREX Pakistan — Design System ("Ore & Ledger")
   Tokens mirror the active Novamira design (novamira/get-active-design)
   ========================================================================== */

/* ---- Self-hosted fonts (no Google Fonts link — performance + privacy) ---- */
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Space Grotesk';
  src: url('fonts/space-grotesk-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/plex-sans-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Sans';
  src: url('fonts/plex-sans-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}

/* ---- Tokens (Ore & Ledger) ---- */
:root {
  --bg: #FAF6EF;
  --surface: #FFFFFF;
  --ink: #1C1611;
  --accent: #C8A230;
  --brown: #73401A;
  --bg-dark: #130D08;
  --surface-dark: #1E1610;
  --ink-on-dark: #F3EEE4;
  --muted: #6B6259;
  --muted-on-dark: #A99C8C;
  --border: #E7DFD1;
  --border-on-dark: rgba(243,238,228,0.14);

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'IBM Plex Sans', sans-serif;

  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 24px;
  --space-lg: 64px;
  --space-xl: 120px;

  --radius-sm: 2px;
  --radius-md: 3px;

  --container-w: 1280px;
  --container-pad: clamp(20px, 5vw, 64px);

  --header-h: 88px;
  --header-h-scrolled: 76px;
  --ease: cubic-bezier(.4,0,.2,1);
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; }
:where(html) { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
:where(body, h1, h2, h3, h4, p, figure, blockquote, dl, dd, ul, ol) { margin: 0; padding: 0; }
:where(ul, ol) { list-style: none; }
:where(a) { color: inherit; text-decoration: none; }
:where(img, svg) { display: block; max-width: 100%; height: auto; }
:where(button) { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

html, body { height: 100%; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
}

.container {
  max-width: var(--container-w);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 32px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background-color .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}
.btn--primary {
  background: var(--accent);
  color: #1C1508;
}
.btn--primary:hover { background: #dbb648; transform: translateY(-1px); }
.btn--ghost {
  background: transparent;
  color: var(--ink-on-dark);
  border-color: var(--border-on-dark);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 11px 22px; font-size: 0.75rem; }
.btn--block { width: 100%; }

/* ---- Header ---- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color .4s var(--ease), border-color .4s var(--ease), height .3s var(--ease);
}
.site-header.is-scrolled {
  background: rgba(19,13,8,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom-color: var(--border-on-dark);
  height: var(--header-h-scrolled);
}
.site-header__inner {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}
.site-header__logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.site-header__logo-img { height: 38px; width: auto; }
.site-header__logo-text {
  font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--ink-on-dark);
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(12px, 1.6vw, 26px);
}
.site-nav__list a {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--ink-on-dark);
  position: relative;
  padding-bottom: 4px;
  display: inline-block;
}
.site-nav__list a::after {
  content: '';
  position: absolute;
  left: 0; right: 100%;
  bottom: 0;
  height: 1px;
  background: var(--accent);
  transition: right .3s var(--ease);
}
.site-nav__list a:hover::after,
.site-nav__list a:focus-visible::after { right: 0; }

.site-header__actions { display: flex; align-items: center; gap: var(--space-md); }

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px; height: 32px;
}
.menu-toggle span {
  display: block; height: 1.5px; width: 100%;
  background: var(--ink-on-dark);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
.menu-toggle.is-active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.is-active span:nth-child(2) { opacity: 0; }
.menu-toggle.is-active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.mobile-nav {
  position: fixed;
  inset: 0;
  top: var(--header-h);
  background: var(--bg-dark);
  padding: var(--space-lg) var(--container-pad);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: var(--space-lg);
  transform: translateX(100%);
  transition: transform .4s var(--ease);
  z-index: 90;
  overflow-y: auto;
}
.mobile-nav.is-open { transform: translateX(0); }
.mobile-nav__list { display: flex; flex-direction: column; gap: var(--space-md); }
.mobile-nav__list a {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--ink-on-dark);
}

@media (max-width: 960px) {
  .site-nav { display: none; }
  .site-header__actions .btn--sm { display: none; }
  .menu-toggle { display: flex; }
}
@media (min-width: 961px) {
  .mobile-nav { display: none; }
}

/* ---- Hero ---- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  background: var(--bg-dark);
  color: var(--ink-on-dark);
  overflow: hidden;
}
.hero__bg { position: absolute; inset: 0; z-index: 0; }
.hero__glow {
  position: absolute;
  top: -20%; right: -8%;
  width: 60vw; height: 60vw;
  max-width: 900px; max-height: 900px;
  background: radial-gradient(circle, rgba(200,162,48,0.28) 0%, rgba(200,162,48,0) 70%);
}
.hero__contours {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
}
.hero__panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: 42%;
  background: linear-gradient(135deg, rgba(115,64,26,0.55), rgba(19,13,8,0.15));
  clip-path: polygon(28% 0, 100% 0, 100% 100%, 0% 100%);
  border-left: 1px solid var(--border-on-dark);
}
.hero__noise {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  opacity: 0.05;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding-block: calc(var(--header-h) + var(--space-lg)) var(--space-xl);
}
.hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
  max-width: 480px;
  margin-bottom: var(--space-md);
}
.hero__headline {
  font-size: clamp(2.75rem, 3.2vw + 2rem, 6rem);
  color: var(--ink-on-dark);
  margin-bottom: var(--space-md);
}
.hero__accent { color: var(--accent); }
.hero__sub {
  font-size: clamp(1rem, .4vw + .9rem, 1.1875rem);
  color: var(--muted-on-dark);
  max-width: 46ch;
  margin-bottom: var(--space-lg);
}
.hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.875rem;
  color: var(--ink-on-dark);
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
}
.hero__meta strong { color: var(--accent); font-family: var(--font-display); letter-spacing: .02em; font-weight: 700; }
.hero__meta-divider { width: 1px; height: 16px; background: var(--border-on-dark); }
.hero__cta { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

.hero__scroll {
  position: absolute;
  bottom: var(--space-lg);
  left: var(--container-pad);
  z-index: 1;
  display: flex;
  align-items: center;
}
.hero__scroll-line {
  display: block;
  width: 1px; height: 48px;
  background: linear-gradient(var(--accent), transparent);
  animation: scrollLine 2.2s var(--ease) infinite;
}
@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  50.001% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

@media (max-width: 640px) {
  .hero__panel { width: 100%; opacity: .45; }
  .hero__content { padding-block: calc(var(--header-h) + var(--space-md)) var(--space-lg); }
  .hero__headline { font-size: clamp(2.25rem, 9vw, 3rem); }
  .hero__cta { flex-direction: column; }
  .hero__cta .btn { width: 100%; }
  .hero__scroll { display: none; }
}

/* ---- Reveal-on-scroll (degrades to visible without JS) ---- */
.reveal { opacity: 1; transform: none; }
html.js:not(.reduced-motion) .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity .8s var(--ease), transform .8s var(--ease);
}
html.js:not(.reduced-motion) .reveal.is-visible {
  opacity: 1;
  transform: none;
}
html.js:not(.reduced-motion) .hero__content > .reveal:nth-child(2) { transition-delay: .08s; }
html.js:not(.reduced-motion) .hero__content > .reveal:nth-child(3) { transition-delay: .16s; }
html.js:not(.reduced-motion) .hero__content > .reveal:nth-child(4) { transition-delay: .24s; }
html.js:not(.reduced-motion) .hero__content > .reveal:nth-child(5) { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
  html.js .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero__scroll-line { animation: none; }
  :where(html) { scroll-behavior: auto; }
}
