/* ============================================
   MG METAL — Industrial Magnesium Alloy Website
   Jiaxing Meiyuan Trading Co., Ltd
   ============================================ */

/* ---------- Design Tokens ---------- */
:root {
  --bg: #0e1116;
  --bg-2: #161b22;
  --surface: #1c232d;
  --surface-2: #232c38;
  --ink: #e9eef4;
  --ink-soft: #c5cdd8;
  --muted: #8893a3;
  --rule: #2b333f;
  --rule-light: #3a4452;
  --accent: #ff7a1a;          /* molten orange */
  --accent-dark: #d96400;
  --accent-2: #4a9eff;        /* steel blue */
  --accent-glow: rgba(255, 122, 26, 0.35);
  --steel-grad: linear-gradient(135deg, #3a4452 0%, #1c232d 50%, #2b333f 100%);
  --brushed: repeating-linear-gradient(90deg, rgba(255,255,255,0.02) 0px, rgba(255,255,255,0.02) 2px, rgba(0,0,0,0.03) 2px, rgba(0,0,0,0.03) 4px);
  --max: 1240px;
  --radius: 4px;
  --shadow: 0 10px 30px rgba(0,0,0,0.45);
  --shadow-accent: 0 8px 24px rgba(255,122,26,0.25);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Barlow', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink-soft);
  line-height: 1.65;
  font-size: 16px;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; transition: color .25s var(--ease); }
ul { list-style: none; }
table { border-collapse: collapse; width: 100%; }

h1, h2, h3, h4, h5 {
  font-family: 'Oswald', 'Barlow Condensed', sans-serif;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: 0.01em;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.2rem); text-transform: uppercase; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.9rem); text-transform: uppercase; }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); }
h4 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.04em; }

p { color: var(--ink-soft); }
.accent { color: var(--accent); }
.accent-2 { color: var(--accent-2); }

/* ---------- Layout ---------- */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; position: relative; }
.section-sm { padding: 64px 0; }
.section-tight { padding: 48px 0; }
.bg-2 { background: var(--bg-2); }
.bg-surface { background: var(--surface); }
.center { text-align: center; }

/* Section heading block */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase; letter-spacing: 0.22em;
  font-size: 0.78rem; font-weight: 500; color: var(--accent);
  margin-bottom: 16px;
}
.eyebrow::before { content: ""; width: 28px; height: 2px; background: var(--accent); display: inline-block; }
.eyebrow.center-on { justify-content: center; }
.head { max-width: 720px; margin-bottom: 56px; }
.head.center { margin-left: auto; margin-right: auto; }
.head p { margin-top: 18px; font-size: 1.05rem; color: var(--muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: 'Oswald', sans-serif;
  text-transform: uppercase; letter-spacing: 0.08em;
  font-size: 0.92rem; font-weight: 500;
  padding: 15px 32px; border: 2px solid var(--accent);
  background: var(--accent); color: #0e1116;
  cursor: pointer; position: relative; overflow: hidden;
  transition: all .3s var(--ease); border-radius: var(--radius);
}
.btn:hover { background: transparent; color: var(--accent); box-shadow: var(--shadow-accent); transform: translateY(-2px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--rule-light); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; box-shadow: none; }
.btn-lg { padding: 18px 42px; font-size: 1rem; }

/* ---------- Top bar ---------- */
.topbar {
  background: #090b0f; border-bottom: 1px solid var(--rule);
  font-size: 0.82rem; color: var(--muted);
}
.topbar .container { display: flex; justify-content: space-between; align-items: center; height: 40px; flex-wrap: wrap; gap: 8px; }
.topbar a { display: inline-flex; align-items: center; gap: 7px; }
.topbar a:hover { color: var(--accent); }
.topbar .tb-links { display: flex; gap: 22px; }

/* ---------- Header / Nav ---------- */
.header {
  position: sticky; top: 0; z-index: 1000;
  background: rgba(14, 17, 22, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
  transition: all .3s var(--ease);
}
.header.scrolled { background: rgba(14,17,22,0.98); box-shadow: 0 6px 20px rgba(0,0,0,0.4); }
.nav { display: flex; align-items: center; justify-content: space-between; height: 76px; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 46px; height: 46px; border-radius: 6px;
  background: var(--steel-grad);
  display: grid; place-items: center;
  font-family: 'Oswald', sans-serif; font-weight: 700; font-size: 1.15rem;
  color: var(--accent); border: 1px solid var(--rule-light);
  position: relative; overflow: hidden;
}
.brand-mark::after { content: ""; position: absolute; inset: 0; background: var(--brushed); }
.brand-name { font-family: 'Oswald', sans-serif; font-weight: 600; font-size: 1.35rem; color: var(--ink); letter-spacing: 0.02em; line-height: 1; }
.brand-name span { color: var(--accent); }
.brand-sub { font-size: 0.62rem; letter-spacing: 0.28em; text-transform: uppercase; color: var(--muted); margin-top: 4px; display: block; }

.menu { display: flex; align-items: center; gap: 4px; }
.menu a {
  font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.06em;
  font-size: 0.9rem; font-weight: 400; color: var(--ink-soft);
  padding: 10px 18px; position: relative;
}
.menu a::after { content: ""; position: absolute; left: 18px; right: 18px; bottom: 4px; height: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.menu a:hover, .menu a.active { color: var(--accent); }
.menu a:hover::after, .menu a.active::after { transform: scaleX(1); }
.nav-cta { margin-left: 14px; }
.nav-toggle { display: none; background: none; border: 1px solid var(--rule-light); color: var(--ink); width: 44px; height: 44px; border-radius: 6px; cursor: pointer; font-size: 1.3rem; }

/* ---------- Hero ---------- */
.hero { position: relative; min-height: 88vh; display: flex; align-items: center; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: 0; }
.hero-bg img { width: 100%; height: 100%; object-fit: cover; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, rgba(14,17,22,0.96) 0%, rgba(14,17,22,0.78) 45%, rgba(14,17,22,0.55) 100%); }
.hero-bg::before { content: ""; position: absolute; inset: 0; background: var(--brushed); opacity: 0.5; z-index: 1; }
.hero-content { position: relative; z-index: 2; padding: 80px 0; }
.hero h1 { max-width: 880px; }
.hero h1 .accent { display: block; }
.hero-lead { max-width: 580px; margin-top: 24px; font-size: 1.15rem; color: var(--ink-soft); }
.hero-actions { margin-top: 40px; display: flex; gap: 16px; flex-wrap: wrap; }
.hero-meta { margin-top: 56px; display: flex; gap: 40px; flex-wrap: wrap; }
.hero-meta-item { display: flex; flex-direction: column; }
.hero-meta-num { font-family: 'Oswald', sans-serif; font-size: 2.4rem; font-weight: 600; color: var(--accent); line-height: 1; }
.hero-meta-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.16em; color: var(--muted); margin-top: 8px; }

/* ---------- Page hero (inner pages) ---------- */
.page-hero { position: relative; padding: 90px 0 70px; overflow: hidden; background: var(--bg-2); border-bottom: 1px solid var(--rule); }
.page-hero::before { content: ""; position: absolute; inset: 0; background: var(--steel-grad); opacity: 0.5; }
.page-hero::after { content: ""; position: absolute; inset: 0; background: var(--brushed); }
.page-hero .container { position: relative; z-index: 2; }
.breadcrumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 16px; text-transform: uppercase; letter-spacing: 0.1em; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb span { color: var(--accent); }
.page-hero h1 { margin-bottom: 16px; }
.page-hero p { max-width: 640px; color: var(--ink-soft); }

/* ---------- Stats strip ---------- */
.stats-strip { background: #090b0f; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); }
.stat { padding: 40px 24px; text-align: center; border-right: 1px solid var(--rule); }
.stat:last-child { border-right: none; }
.stat-num { font-family: 'Oswald', sans-serif; font-size: 2.6rem; font-weight: 600; color: var(--accent); line-height: 1; }
.stat-num span { font-size: 1.4rem; }
.stat-label { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.14em; color: var(--muted); margin-top: 10px; }

/* ---------- Cards grid ---------- */
.grid { display: grid; gap: 28px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius);
  overflow: hidden; transition: all .35s var(--ease); position: relative;
}
.card:hover { transform: translateY(-6px); border-color: var(--accent); box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 4/3; overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.card:hover .card-media img { transform: scale(1.06); }
.card-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(14,17,22,0.85) 0%, transparent 50%); }
.card-tag { position: absolute; top: 16px; left: 16px; z-index: 2; font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.72rem; background: var(--accent); color: #0e1116; padding: 5px 12px; border-radius: 3px; font-weight: 500; }
.card-body { padding: 28px; }
.card-body h3 { margin-bottom: 12px; }
.card-body p { color: var(--muted); font-size: 0.95rem; }
.card-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; color: var(--accent); font-weight: 500; }
.card-link svg { transition: transform .3s var(--ease); }
.card:hover .card-link svg { transform: translateX(5px); }

/* ---------- Feature / icon cards ---------- */
.feature { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 34px 28px; transition: all .35s var(--ease); position: relative; overflow: hidden; }
.feature::before { content: ""; position: absolute; top: 0; left: 0; width: 3px; height: 0; background: var(--accent); transition: height .4s var(--ease); }
.feature:hover { border-color: var(--rule-light); transform: translateY(-4px); }
.feature:hover::before { height: 100%; }
.feature-icon { width: 56px; height: 56px; border-radius: 8px; background: var(--steel-grad); display: grid; place-items: center; margin-bottom: 22px; border: 1px solid var(--rule-light); color: var(--accent); }
.feature-icon svg { width: 28px; height: 28px; }
.feature h3 { margin-bottom: 12px; }
.feature p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Alloy badges ---------- */
.alloy-row { display: flex; gap: 20px; flex-wrap: wrap; }
.alloy-badge {
  flex: 1; min-width: 220px; background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--radius); padding: 30px; text-align: center; position: relative; overflow: hidden;
  transition: all .35s var(--ease);
}
.alloy-badge::after { content: ""; position: absolute; inset: 0; background: var(--brushed); opacity: 0.4; pointer-events: none; }
.alloy-badge:hover { border-color: var(--accent); transform: translateY(-4px); }
.alloy-name { font-family: 'Oswald', sans-serif; font-size: 2rem; font-weight: 700; color: var(--accent); position: relative; z-index: 1; }
.alloy-desc { font-size: 0.9rem; color: var(--muted); margin-top: 10px; position: relative; z-index: 1; }

/* ---------- Tables (specs) ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); }
.spec-table th, .spec-table td { padding: 16px 20px; text-align: left; font-size: 0.95rem; }
.spec-table thead th { background: var(--steel-grad); color: var(--ink); font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.82rem; font-weight: 500; border-bottom: 2px solid var(--accent); }
.spec-table tbody tr { border-bottom: 1px solid var(--rule); transition: background .2s; }
.spec-table tbody tr:last-child { border-bottom: none; }
.spec-table tbody tr:hover { background: var(--surface-2); }
.spec-table td { color: var(--ink-soft); }
.spec-table .pill { display: inline-block; padding: 3px 10px; border-radius: 20px; background: rgba(74,158,255,0.12); color: var(--accent-2); font-size: 0.8rem; font-weight: 500; }

/* ---------- Split (image + text) ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.split-media { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); position: relative; }
.split-media img { width: 100%; height: 100%; object-fit: cover; }
.split-media::after { content: ""; position: absolute; inset: 0; background: var(--brushed); opacity: 0.25; pointer-events: none; }
.split-text h2 { margin-bottom: 22px; }
.split-text p { margin-bottom: 18px; color: var(--ink-soft); }
.check-list { margin-top: 24px; }
.check-list li { display: flex; gap: 12px; margin-bottom: 14px; align-items: flex-start; color: var(--ink-soft); }
.check-list svg { flex-shrink: 0; width: 22px; height: 22px; color: var(--accent); margin-top: 2px; }

/* ---------- CTA band ---------- */
.cta-band { position: relative; overflow: hidden; background: var(--steel-grad); border-top: 1px solid var(--accent); border-bottom: 1px solid var(--rule); }
.cta-band::before { content: ""; position: absolute; inset: 0; background: var(--brushed); opacity: 0.4; }
.cta-band::after { content: ""; position: absolute; right: -100px; top: -100px; width: 400px; height: 400px; background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%); }
.cta-band .container { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; padding: 64px 24px; }
.cta-band h2 { margin-bottom: 8px; }
.cta-band p { color: var(--ink-soft); max-width: 520px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 48px; }
.info-card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 30px; display: flex; gap: 18px; align-items: flex-start; transition: all .3s var(--ease); }
.info-card:hover { border-color: var(--accent); transform: translateX(4px); }
.info-card .ic-icon { width: 48px; height: 48px; flex-shrink: 0; border-radius: 8px; background: var(--steel-grad); display: grid; place-items: center; color: var(--accent); border: 1px solid var(--rule-light); }
.info-card h4 { margin-bottom: 6px; }
.info-card p, .info-card a { color: var(--ink-soft); font-size: 1rem; }
.info-card a:hover { color: var(--accent); }

.form { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 36px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.06em; font-size: 0.78rem; color: var(--muted); margin-bottom: 8px; }
.form-control { width: 100%; background: var(--bg); border: 1px solid var(--rule-light); border-radius: var(--radius); padding: 13px 16px; color: var(--ink); font-family: 'Barlow', sans-serif; font-size: 1rem; transition: border-color .25s; }
.form-control:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-glow); }
textarea.form-control { resize: vertical; min-height: 130px; }

/* ---------- Footer ---------- */
.footer { background: #090b0f; border-top: 1px solid var(--rule); padding: 72px 0 0; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 56px; }
.footer .brand { margin-bottom: 20px; }
.footer-about p { color: var(--muted); font-size: 0.92rem; max-width: 320px; }
.footer h4 { color: var(--ink); margin-bottom: 20px; font-size: 0.9rem; }
.footer-links li { margin-bottom: 12px; }
.footer-links a { color: var(--muted); font-size: 0.92rem; }
.footer-links a:hover { color: var(--accent); padding-left: 4px; }
.footer-contact li { display: flex; gap: 10px; margin-bottom: 14px; color: var(--muted); font-size: 0.92rem; align-items: flex-start; }
.footer-contact svg { width: 18px; height: 18px; color: var(--accent); flex-shrink: 0; margin-top: 3px; }
.footer-bottom { border-top: 1px solid var(--rule); padding: 24px 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 0.84rem; color: var(--muted); }
.footer-bottom a:hover { color: var(--accent); }

/* ---------- Application chips ---------- */
.app-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.app-item { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px 18px; text-align: center; transition: all .3s var(--ease); }
.app-item:hover { border-color: var(--accent); transform: translateY(-4px); }
.app-item svg { width: 36px; height: 36px; color: var(--accent); margin: 0 auto 14px; }
.app-item span { font-family: 'Oswald', sans-serif; text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.9rem; color: var(--ink); }

/* ---------- Process steps ---------- */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; counter-reset: step; }
.step { position: relative; padding: 36px 26px; background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); }
.step::before { counter-increment: step; content: "0" counter(step); position: absolute; top: -16px; left: 26px; font-family: 'Oswald', sans-serif; font-size: 1.5rem; font-weight: 700; color: var(--accent); background: var(--bg); padding: 0 10px; }
.step h4 { margin: 10px 0 10px; }
.step p { color: var(--muted); font-size: 0.9rem; }

/* ---------- Reveal animation ---------- */
.reveal { opacity: 0; transform: translateY(30px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

/* ---------- Back to top ---------- */
.to-top { position: fixed; right: 24px; bottom: 24px; width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #0e1116; border: none; cursor: pointer; display: grid; place-items: center; opacity: 0; visibility: hidden; transform: translateY(10px); transition: all .3s var(--ease); z-index: 900; box-shadow: var(--shadow-accent); }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { background: var(--accent-dark); }

/* ---------- 404 ---------- */
.notfound { min-height: 70vh; display: grid; place-items: center; text-align: center; }
.notfound .code { font-family: 'Oswald', sans-serif; font-size: clamp(5rem, 18vw, 12rem); font-weight: 700; color: var(--accent); line-height: 1; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .app-grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(1), .stat:nth-child(2) { border-bottom: 1px solid var(--rule); }
}
@media (max-width: 860px) {
  .menu { display: none; position: absolute; top: 76px; left: 0; right: 0; background: var(--bg-2); flex-direction: column; padding: 16px; border-bottom: 1px solid var(--rule); gap: 0; }
  .menu.open { display: flex; }
  .menu a { padding: 14px 18px; border-bottom: 1px solid var(--rule); width: 100%; }
  .menu a::after { display: none; }
  .nav-cta { display: none; }
  .nav-toggle { display: grid; place-items: center; }
  .split { grid-template-columns: 1fr; gap: 32px; }
  .contact-grid { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .section { padding: 64px 0; }
  .hero { min-height: auto; }
  .cta-band .container { flex-direction: column; text-align: center; align-items: center; }
  .form-row { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid-4, .app-grid, .steps, .stats-grid { grid-template-columns: 1fr; }
  .stat { border-right: none; border-bottom: 1px solid var(--rule); }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-meta { gap: 28px; }
  .topbar .tb-links { display: none; }
}
