/* ────────────────────────────────────────────
   NrgOpt — style.css
   Enterprise Clean Energy Solutions
   Dark/Light theme + EN/ZH/JA trilingual
   ──────────────────────────────────────────── */

/* ── RESET ── */
*, *::before, *::after { margin:0; padding:0; box-sizing:border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }

/* ── DARK THEME (default) ── */
:root, [data-theme="dark"] {
  --bg: #0a0e1a;
  --surface: #111827;
  --text: #e2e8f0;
  --text-dim: #94a3b8;
  --accent: #38bdf8;
  --accent2: #818cf8;
  --gold: #f59e0b;
  --border: #1e293b;
  --shadow: 0 4px 20px rgba(0,0,0,0.3);
  --nav-bg: rgba(10,14,26,0.9);
  --hero-bg1: rgba(56,189,248,0.12);
  --hero-bg2: rgba(129,140,248,0.08);
  --hero-grad: linear-gradient(135deg, #0a0e1a 0%, #0f1725 40%, #111827 70%, #0a0e1a 100%);
  --body-grad1: rgba(56,189,248,0.06);
  --body-grad2: rgba(129,140,248,0.04);
  --body-grad3: rgba(56,189,248,0.04);
  --body-grad4: rgba(245,158,11,0.02);
  --dot-color: rgba(148,163,184,0.3);
  --dot-opacity: 0.12;
  --section-odd: linear-gradient(180deg, #0a0e1a 0%, #0f1725 50%, #0a0e1a 100%);
  --section-even: linear-gradient(180deg, #111827 0%, #0f1725 40%, #111827 100%);
  --btn-primary-text: #0a0e1a;
  --btn-primary-hover-bg: #7dd3fc;
  --lang-hover-text: #0a0e1a;
  --focus-ring: #38bdf8;
  --form-bg: #1e293b;
  --form-border: #334155;
  --success: #34d399;
  --error: #f87171;
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #1e293b;
  --text-dim: #64748b;
  --accent: #0284c7;
  --accent2: #6366f1;
  --gold: #d97706;
  --border: #e2e8f0;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --nav-bg: rgba(255,255,255,0.92);
  --hero-bg1: rgba(2,132,199,0.1);
  --hero-bg2: rgba(99,102,241,0.06);
  --hero-grad: linear-gradient(135deg, #f0f9ff 0%, #f8fafc 40%, #fefce8 70%, #f8fafc 100%);
  --body-grad1: rgba(2,132,199,0.05);
  --body-grad2: rgba(99,102,241,0.03);
  --body-grad3: rgba(2,132,199,0.04);
  --body-grad4: rgba(217,119,6,0.02);
  --dot-color: rgba(100,116,139,0.2);
  --dot-opacity: 0.25;
  --section-odd: linear-gradient(180deg, #f8fafc 0%, #f0f9ff 50%, #f8fafc 100%);
  --section-even: linear-gradient(180deg, #ffffff 0%, #f8fafc 40%, #ffffff 100%);
  --btn-primary-text: #fff;
  --btn-primary-hover-bg: #0369a1;
  --lang-hover-text: #fff;
  --focus-ring: #0284c7;
  --form-bg: #f1f5f9;
  --form-border: #cbd5e1;
  --success: #059669;
  --error: #dc2626;
}

/* ── TYPOGRAPHY ── */
body {
  font-family: 'PingFang SC','Microsoft YaHei',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── GLOBAL PATTERN ── */
body::before {
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  background:
    radial-gradient(ellipse 900px 600px at 10% 20%, var(--body-grad1) 0%, transparent 60%),
    radial-gradient(ellipse 800px 500px at 85% 50%, var(--body-grad2) 0%, transparent 55%),
    radial-gradient(ellipse 700px 500px at 40% 80%, var(--body-grad3) 0%, transparent 55%),
    radial-gradient(ellipse 600px 400px at 60% 10%, var(--body-grad4) 0%, transparent 50%);
  background-size: cover;
}
body::after {
  content:'';
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:0;
  opacity: var(--dot-opacity);
  background-image: radial-gradient(circle, var(--dot-color) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* ── SKIP LINK ── */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  background: var(--accent);
  color: var(--btn-primary-text);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
  z-index: 200;
  transition: top 0.3s;
}
.skip-link:focus {
  top: 8px;
}

/* ── NAV ── */
.nav {
  position: fixed;
  top:0;
  left:0;
  right:0;
  z-index:100;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
}
.nav-logo {
  font-size: 1.2rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-logo .primary { color: var(--accent); }
.nav-logo .sub {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-dim);
  margin-left: 6px;
}
.nav-links {
  display: flex;
  gap: 22px;
  list-style: none;
  align-items: center;
}
.nav-links a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
}
.nav-tools {
  display: flex;
  gap: 8px;
  align-items: center;
}
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1;
}
.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 2;
}
.theme-toggle:hover {
  background: var(--accent);
}
.theme-toggle:hover svg {
  stroke: var(--lang-hover-text);
}
.lang-select {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1.5px solid var(--accent);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
}
.lang-select option {
  background: var(--surface);
  color: var(--text);
}

/* ── FOCUS VISIBLE ── */
:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}
.nav-links a:focus-visible,
.btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}
.lang-select:focus-visible,
.theme-toggle:focus-visible {
  outline: none;
}

/* ── SECTIONS ── */
section {
  padding: 90px 0;
  position: relative;
}
section:nth-child(odd) { background: var(--section-odd); }
section:nth-child(even) { background: var(--section-even); }
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 2;
}
.section-label {
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: var(--accent);
  margin-bottom: 8px;
  text-transform: uppercase;
  font-weight: 600;
}
.section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 12px;
}
.section-desc {
  color: var(--text-dim);
  max-width: 620px;
  margin-bottom: 36px;
  font-size: 1.02rem;
}

/* ── HERO ── */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: var(--hero-grad);
  padding-top: 62px;
  position: relative;
  z-index: 1;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.3;
  background:
    radial-gradient(circle at 30% 35%, var(--hero-bg1) 0%, transparent 50%),
    radial-gradient(circle at 65% 55%, var(--hero-bg2) 0%, transparent 50%);
  filter: blur(80px);
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 24px;
  color: var(--text);
}
.hero h1 .hl { color: var(--accent); }
.hero .hero-sub {
  font-size: 1.1rem;
  color: var(--text-dim);
  max-width: 560px;
  margin-bottom: 48px;
  line-height: 1.65;
}
.hero .btn-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ── BUTTONS ── */
.btn {
  padding: 13px 30px;
  border-radius: 28px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
}
.btn-primary {
  background: var(--accent);
  color: var(--btn-primary-text);
}
.btn-primary:hover { background: var(--btn-primary-hover-bg); }
.btn-outline {
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.btn-outline:hover {
  background: var(--accent);
  color: var(--btn-primary-text);
}

/* ── IMAGE BANNER (responsive picture-based) ── */
.img-banner {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
  line-height: 0;
}
.img-banner img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  max-height: 400px;
}

/* ── CARDS ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 26px 28px;
  box-shadow: var(--shadow);
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}
.card:hover {
  transform: translateY(-2px);
}
[data-theme="dark"] .card:hover {
  box-shadow: 0 6px 28px rgba(0,0,0,0.4);
  border-color: #334155;
}
[data-theme="light"] .card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.08);
  border-color: #d1d5db;
}
.card h3 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  font-weight: 600;
}
.card p {
  color: var(--text-dim);
  font-size: 0.9rem;
}

/* ── DOC CARDS ── */
.doc-icon {
  font-size: 2rem;
  margin-bottom: 8px;
}
.doc-downloads {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.doc-btn {
  display: inline-block;
  padding: 8px 20px;
  border-radius: 8px;
  background: var(--surface);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
}
.doc-btn:hover {
  background: var(--accent);
  color: var(--btn-primary-text);
}
.doc-soon {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 20px;
  border-radius: 8px;
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-size: 0.82rem;
}

/* ── STATS ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 18px;
  margin: 30px 0;
}
.stat {
  text-align: center;
  padding: 22px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.stat .number {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--accent);
}
.stat .label {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 4px;
}

/* ── TWO-COL ── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.two-col > div {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ── CONTACT ROW ── */
.contact-row {
  display: flex;
  gap: 20px;
  max-width: 780px;
  margin: 0 auto 32px;
}
.contact-row .card {
  flex: 1;
  text-align: center;
  min-width: 0;
}

/* ── CONTACT FORM ── */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}
.contact-form .form-group {
  margin-bottom: 18px;
}
.contact-form label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--form-border);
  background: var(--form-bg);
  color: var(--text);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}
.contact-form .btn-submit {
  width: 100%;
  padding: 13px;
  border-radius: 28px;
  border: none;
  background: var(--accent);
  color: var(--btn-primary-text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.contact-form .btn-submit:hover {
  background: var(--btn-primary-hover-bg);
}
.contact-form .btn-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.form-status {
  text-align: center;
  margin-top: 12px;
  font-size: 0.9rem;
  min-height: 24px;
}
.form-status.success { color: var(--success); }
.form-status.error { color: var(--error); }

/* ── BACK TO TOP ── */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--btn-primary-text);
  border: none;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  box-shadow: var(--shadow);
  pointer-events: none;
}
.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.back-to-top:hover {
  background: var(--btn-primary-hover-bg);
}

/* ── REVEAL ANIMATIONS ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── LANGUAGE ── */
.zh, .ja { display: none; }
body.lang-zh .zh { display: block; }
body.lang-zh .en,
body.lang-zh .ja { display: none; }
body.lang-ja .ja { display: block; }
body.lang-ja .en,
body.lang-ja .zh { display: none; }
/* en elements keep their natural display (block for p/h2, inline for span) */
/* nav logo sub handling */
body.lang-zh .nav-logo .sub.en,
body.lang-ja .nav-logo .sub.en { display: none; }
body.lang-en .nav-logo .sub.zh,
body.lang-en .nav-logo .sub.ja,
body.lang-ja .nav-logo .sub.zh { display: none; }
body.lang-zh .nav-logo .sub.zh { display: inline; }
body.lang-ja .nav-logo .sub.ja { display: inline; }

/* ── FOOTER ── */
footer {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-dim);
  font-size: 0.82rem;
  background: var(--bg);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}
footer .container { max-width: 1080px; margin: 0 auto; }

/* ── PRINT STYLES ── */
@media print {
  .nav, .back-to-top, .btn-row, .contact-form, .theme-toggle, .lang-select { display: none !important; }
  body { background: #fff; color: #000; font-size: 12pt; }
  section { padding: 20px 0; page-break-inside: avoid; }
  .card { border: 1px solid #ccc; box-shadow: none; }
  .img-banner img { max-height: 200px; }
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .two-col { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  section { padding: 60px 0; }
  .hero h1 { font-size: clamp(1.6rem, 7vw, 2.4rem); }
  .section-title { font-size: 1.4rem; }
  .section-desc { font-size: 0.95rem; }
  .nav-inner {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 16px;
    gap: 8px;
  }
  .nav-links { gap: 12px; flex-wrap: wrap; }
  .nav-links a { font-size: 0.8rem; }
  .nav-tools { gap: 6px; }
  .lang-toggle,
  .theme-toggle { padding: 4px 10px; font-size: 0.72rem; }
  .img-banner { border-radius: 10px; }
  .img-banner img { max-height: 220px; }
  .card-grid { grid-template-columns: 1fr; }
  .stat-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .stat { padding: 16px 12px; }
  .stat .number { font-size: 1.5rem; }
  .contact-row { flex-direction: column; }
  .contact-row .card { padding: 18px 20px; }
  .contact-form { padding: 24px 18px; }
  footer { font-size: 0.75rem; padding: 32px 16px; }
  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }
}
@media (max-width: 480px) {
  .nav-links { gap: 8px; }
  .hero { min-height: 90vh; }
  .hero-sub { font-size: 0.9rem; }
  .btn { padding: 10px 20px; font-size: 0.85rem; }
  .stat-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .stat .number { font-size: 1.3rem; }
  .img-banner { border-radius: 10px; }
  .img-banner img { max-height: 180px; }
  .container { padding: 0 16px; }
  .contact-form { padding: 20px 14px; }
}

/* ── PREFERS REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
