/* Xinhai Mining EPC+M+O - site.css
   Tokens mirror DESIGN.md. Dark theme locked, single copper accent. */

:root {
  --ink: #0E1112;
  --surface: #151A1B;
  --surface-2: #1C2224;
  --line: #2A3234;
  --line-strong: #3C4649;
  --text: #E7EBEA;
  --text-muted: #98A3A5;
  --accent: #C86A2E;
  --accent-hover: #DD7D3B;
  --accent-ink: #0E1112;
  --danger: #D9534F;
  --ok: #5FA777;

  --font-display: 'Space Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --font-body: 'IBM Plex Sans', 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, SFMono-Regular, monospace;

  --radius: 4px;
  --container: 1240px;
  --section-y: clamp(4.5rem, 9vw, 7.5rem);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --fast: 160ms;
  --base: 260ms;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

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

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2.3rem, 4.6vw, 3.6rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); letter-spacing: -0.02em; }
h3 { font-size: 1.25rem; letter-spacing: -0.01em; }
h4 { font-size: 1.0625rem; }
p { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }

.wrap { width: min(100% - 2.5rem, var(--container)); margin-inline: auto; }
.lede { font-size: 1.15rem; color: var(--text-muted); max-width: 68ch; }
.muted { color: var(--text-muted); }
.num { font-family: var(--font-mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.eyebrow {
  font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 1rem;
}

/* ---------- skip link ---------- */
.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .7rem 1.1rem; font-weight: 600;
}
.skip:focus { left: 1rem; top: 1rem; }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(14, 17, 18, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}
.nav {
  height: 72px; display: flex; align-items: center; gap: 2rem;
}
.brand { display: flex; align-items: center; gap: .75rem; flex: none; }
.brand img { width: 122px; height: auto; }
.nav-links { display: flex; align-items: center; gap: 1.35rem; margin-left: auto; }
.nav-links a {
  font-size: 0.94rem; color: var(--text-muted); letter-spacing: 0.01em;
  padding: .35rem 0; border-bottom: 1px solid transparent; transition: color var(--fast) var(--ease);
}
.nav-links a[aria-current="page"] { color: var(--text); border-bottom-color: var(--accent); }
.nav-cta {
  font-family: var(--font-body); font-size: .88rem; font-weight: 600;
  background: var(--accent); color: var(--accent-ink); padding: .6rem 1.05rem;
  border-radius: var(--radius); white-space: nowrap;
  transition: background var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.nav-toggle { display: none; }

@media (hover: hover) and (pointer: fine) {
  .nav-links a:hover { color: var(--text); }
  .nav-cta:hover { background: var(--accent-hover); }
}
.nav-cta:active { transform: translateY(1px); }

@media (max-width: 980px) {
  .nav-links {
    position: fixed; inset: 72px 0 auto 0; flex-direction: column; align-items: flex-start;
    gap: 0; background: var(--surface); border-bottom: 1px solid var(--line);
    padding: .5rem 1.25rem 1.25rem; margin: 0;
    max-height: 82vh; overflow-y: auto;
    opacity: 0; visibility: hidden; transform: translateY(-6px);
    transition: opacity 200ms var(--ease), transform 200ms var(--ease), visibility 0s linear 200ms;
  }
  .nav-links.open { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav-links a { width: 100%; padding: .85rem 0; border-bottom: 1px solid var(--line); }
  .nav-links .nav-cta { margin-top: 1rem; text-align: center; border-bottom: none; }
  .nav-toggle {
    display: flex; flex-direction: column; justify-content: center; gap: 5px;
    margin-left: auto; width: 44px; height: 44px; padding: 0 10px;
    background: none; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer;
  }
  .nav-toggle span { display: block; height: 1.5px; background: var(--text); transition: transform var(--fast) var(--ease); }
}

/* ---------- hero ---------- */
.hero { position: relative; border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; opacity: .38; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, var(--ink) 22%, rgba(14,17,18,.72) 58%, rgba(14,17,18,.42) 100%);
}
.hero-body {
  position: relative; padding-block: clamp(4.5rem, 11vw, 8.5rem) clamp(3.5rem, 8vw, 6rem);
  max-width: 48rem;
}
.hero-body h1 { margin-bottom: 1.4rem; }
.hero-body .lede { font-size: 1.2rem; color: #C3CBCC; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: 2.1rem; }

.hero--page .hero-body { padding-block: clamp(3.2rem, 7vw, 5.5rem) clamp(2.6rem, 5vw, 4rem); max-width: 52rem; }
.hero--page h1 { font-size: clamp(2rem, 4vw, 3.1rem); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--font-body); font-size: .95rem; font-weight: 600;
  padding: .85rem 1.5rem; border-radius: var(--radius); border: 1px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), transform var(--fast) var(--ease);
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-ghost { border-color: var(--line-strong); color: var(--text); background: transparent; }
@media (hover: hover) and (pointer: fine) {
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* ---------- sections ---------- */
.section { padding-block: var(--section-y); }
.section--surface { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { max-width: 62ch; margin-bottom: 3rem; }
.section-head h2 { margin-bottom: 1rem; }

/* data strip */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.stats > div { padding: 1.9rem 1.5rem 1.7rem; border-bottom: 1px solid var(--line); border-right: 1px solid var(--line); }
.stats > div:last-child { border-right: none; }
.stats .num { display: block; font-size: clamp(1.9rem, 3.4vw, 2.9rem); color: var(--text); line-height: 1; letter-spacing: -0.03em; }
.stats span.label { display: block; margin-top: .7rem; font-size: .85rem; color: var(--text-muted); }
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stats > div:nth-child(2n) { border-right: none; }
}

/* numbered rail (process) */
.rail { display: grid; gap: 0; border-top: 1px solid var(--line); }
.rail-item {
  display: grid; grid-template-columns: 4.5rem 1fr; gap: 1.5rem;
  padding: 2rem 0; border-bottom: 1px solid var(--line);
}
.rail-item .key { font-family: var(--font-mono); font-size: 1.6rem; color: var(--accent); line-height: 1; }
.rail-item h3 { margin-bottom: .6rem; }
.rail-item p { color: var(--text-muted); max-width: 62ch; }
@media (max-width: 640px) { .rail-item { grid-template-columns: 1fr; gap: .6rem; } }

/* split feature */
.split { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.split--rev > *:first-child { order: 2; }
.split img { border-radius: var(--radius); border: 1px solid var(--line); }
.split ul { margin: 1.4rem 0 0; padding: 0; list-style: none; }
.split ul li { position: relative; padding: .55rem 0 .55rem 1.4rem; color: var(--text-muted); border-bottom: 1px solid var(--line); }
.split ul li::before { content: ""; position: absolute; left: 0; top: 1.15rem; width: 7px; height: 1px; background: var(--accent); }
@media (max-width: 900px) {
  .split { grid-template-columns: 1fr; }
  .split--rev > *:first-child { order: 0; }
}

/* card list (services / solutions) */
.cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.card {
  background: var(--surface); padding: 2rem 1.9rem 1.9rem; display: flex; flex-direction: column;
  transition: background var(--base) var(--ease), transform var(--fast) var(--ease);
}
.card h3 { margin-bottom: .7rem; }
.card p { color: var(--text-muted); font-size: .98rem; }
.card .card-more { margin-top: auto; padding-top: 1.2rem; font-size: .88rem; color: var(--accent); font-weight: 600; }
.card img { margin: -2rem -1.9rem 1.5rem; width: calc(100% + 3.8rem); max-width: none; aspect-ratio: 16/8; object-fit: cover; }
@media (hover: hover) and (pointer: fine) { a.card:hover { background: var(--surface-2); } }
a.card:active { transform: translateY(1px); }
@media (max-width: 780px) { .cards { grid-template-columns: 1fr; } }

.cards--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cards--3 { grid-template-columns: 1fr; } }

/* technical table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; min-width: 32rem; }
caption { text-align: left; padding: 1rem 1.2rem; color: var(--text-muted); font-size: .88rem; border-bottom: 1px solid var(--line); }
th, td { text-align: left; padding: .95rem 1.2rem; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--surface-2); font-family: var(--font-body); font-weight: 600; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); }
tbody tr:last-child td { border-bottom: none; }
td .num, th .num { color: var(--text); }
td a { color: var(--accent); border-bottom: 1px solid rgba(200,106,46,.35); }
@media (hover: hover) and (pointer: fine) { td a:hover { border-bottom-color: var(--accent); } }

/* column grid, hairline separated, no card fill */
.colgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1px solid var(--line); }
.colgrid > div { padding: 1.9rem 1.8rem 1.6rem 0; border-right: 1px solid var(--line); }
.colgrid > div + div { padding-left: 1.8rem; }
.colgrid > div:last-child { border-right: none; }
.colgrid h3 { margin-bottom: .8rem; font-size: 1.1rem; }
.colgrid p { color: var(--text-muted); font-size: .96rem; }
@media (max-width: 860px) {
  .colgrid { grid-template-columns: 1fr; }
  .colgrid > div { border-right: none; border-bottom: 1px solid var(--line); padding: 1.6rem 0; }
  .colgrid > div + div { padding-left: 0; }
}

/* index rows (projects) */
.rows { border-top: 1px solid var(--line); }
.row-item {
  display: grid; grid-template-columns: 8.5rem 1fr auto; gap: 1.5rem; align-items: center;
  padding: 1.4rem 0; border-bottom: 1px solid var(--line);
  transition: transform var(--base) var(--ease);
}
.row-item .place { font-family: var(--font-mono); font-size: .85rem; color: var(--accent); }
.row-item h3 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; }
.row-item .scope { font-size: .85rem; color: var(--text-muted); font-family: var(--font-mono); }
@media (hover: hover) and (pointer: fine) { a.row-item:hover { padding-left: .7rem; } }
@media (max-width: 760px) {
  .row-item { grid-template-columns: 1fr; gap: .35rem; }
}

/* mosaic */
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.mosaic figure {
  margin: 0; display: flex; flex-direction: column; min-width: 0;
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface);
}
.mosaic img { width: 100%; height: auto; object-fit: cover; aspect-ratio: 4/3; }
.mosaic .wide img { aspect-ratio: 8/3; }
.mosaic figcaption { margin-top: auto; padding: .8rem 1rem; font-size: .82rem; color: var(--text-muted); }
.mosaic .wide { grid-column: span 2; }
@media (max-width: 900px) {
  .mosaic { grid-template-columns: repeat(2, 1fr); }
  .mosaic .wide { grid-column: span 2; }
  .mosaic .wide img { aspect-ratio: 16/7; }
}
@media (max-width: 520px) {
  .mosaic { grid-template-columns: 1fr; }
  .mosaic .wide { grid-column: span 1; }
  .mosaic img, .mosaic .wide img { aspect-ratio: 16/9; }
}

/* pill list */
.pills { display: flex; flex-wrap: wrap; gap: .55rem; padding: 0; margin: 1.2rem 0 0; list-style: none; }
.pills li { font-family: var(--font-mono); font-size: .82rem; color: var(--text-muted); border: 1px solid var(--line); border-radius: var(--radius); padding: .35rem .7rem; }

/* disclosure (FAQ) */
.faq { border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 1.3rem 2.5rem 1.3rem 0; position: relative;
  font-family: var(--font-display); font-weight: 600; font-size: 1.08rem;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: .4rem; top: 1.15rem; color: var(--accent);
  font-family: var(--font-mono); font-size: 1.3rem; transition: transform var(--fast) var(--ease);
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 1.4rem; color: var(--text-muted); max-width: 70ch; }

/* statement band */
.band { background: var(--surface-2); border-block: 1px solid var(--line); }
.band .wrap { padding-block: clamp(3.5rem, 7vw, 5.5rem); }
.band p.statement {
  font-family: var(--font-display); font-size: clamp(1.5rem, 2.9vw, 2.3rem); line-height: 1.28;
  max-width: 26ch; margin: 0;
}
.band .side { color: var(--text-muted); max-width: 46ch; }
.band-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: end; }
@media (max-width: 860px) { .band-grid { grid-template-columns: 1fr; } }

/* breadcrumbs */
.crumbs { font-size: .82rem; color: var(--text-muted); padding-top: 1.5rem; font-family: var(--font-mono); }
.crumbs a { color: var(--text-muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs span { padding: 0 .45rem; color: var(--line-strong); }

/* prose */
.prose { max-width: 70ch; }
.prose h2 { margin: 2.6rem 0 1rem; }
.prose h3 { margin: 2rem 0 .7rem; }
.prose ul, .prose ol { color: var(--text-muted); padding-left: 1.2rem; }
.prose li { margin-bottom: .45rem; }

/* form */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .45rem; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: .85rem; font-weight: 600; color: var(--text); }
.field .hint { font-size: .78rem; color: var(--text-muted); }
.field input, .field select, .field textarea {
  font-family: var(--font-body); font-size: 1rem; color: var(--text);
  background: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: .8rem .9rem; width: 100%;
  transition: border-color var(--fast) var(--ease);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #7C8688; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); }
.field .error { font-size: .8rem; color: var(--danger); min-height: 0; }
.field .error:empty { display: none; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"] { border-color: var(--danger); }
.form-note { font-size: .85rem; color: var(--text-muted); margin-top: 1rem; }
.form-status { margin-top: 1rem; font-size: .95rem; }
.form-status[data-state="ok"] { color: var(--ok); }
.form-status[data-state="error"] { color: var(--danger); }
.honey { position: absolute; left: -9999px; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }

/* footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-block: 3.5rem 2rem; margin-top: 0; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2.5rem; }
.footer-grid h4 { font-family: var(--font-body); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 1rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin-bottom: .55rem; }
.footer-grid a { font-size: .92rem; color: var(--text-muted); }
.footer-grid a:hover { color: var(--accent); }
.footer-brand img { width: 190px; margin-bottom: 1.2rem; }
.footer-brand p { font-size: .9rem; color: var(--text-muted); max-width: 34ch; }
.footer-base {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  margin-top: 3rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--text-muted);
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; } }

/* hero headline word reveal (reactbits Split Text, ported to vanilla) */
.js .word { display: inline-block; opacity: 0; transform: translateY(0.36em); }
.js .word-in { animation: word-up 420ms var(--ease) both; }
@keyframes word-up {
  from { opacity: 0; transform: translateY(0.36em); }
  to { opacity: 1; transform: translateY(0); }
}

/* reveal animation, gated on js + reduced motion */
.js .reveal { opacity: 0; transform: translateY(18px); }
.js .reveal.in { opacity: 1; transform: none; transition: opacity var(--base) var(--ease), transform var(--base) var(--ease); }
.js .reveal.in.d1 { transition-delay: 60ms; }
.js .reveal.in.d2 { transition-delay: 120ms; }
.js .reveal.in.d3 { transition-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal, .js .reveal.in { opacity: 1; transform: none; transition: none; }
  .js .word, .js .word-in { opacity: 1; transform: none; animation: none; }
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
