/* ===== CSS Custom Properties ===== */
:root {
  --bg-primary: #0e1e2a;
  --bg-secondary: #152535;
  --bg-card: #1a3040;
  --bg-hover: #1a3a4a;
  --accent-teal: #5DC9E0;
  --accent-blue: #378ADD;
  --accent-green: #1D9E75;
  --accent-amber: #EF9F27;
  --accent-red: #E24B4A;
  --text-heading: #ffffff;
  --text-body: #8aafbf;
  --text-muted: #5a8a9a;
  --border-subtle: #2a4a5a;
  --font-primary: 'DM Sans', sans-serif;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  scroll-padding-top: 100px;
}

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

body {
  font-family: var(--font-primary);
  background: var(--bg-primary);
  color: var(--text-body);
  line-height: 1.6;
  overflow-x: hidden;
}

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

a {
  color: var(--accent-teal);
  text-decoration: none;
  transition: color 0.2s;
}
a:hover { color: #fff; }

h1, h2, h3, h4 {
  color: var(--text-heading);
  line-height: 1.2;
  font-weight: 500;
}

/* ===== Skip Link ===== */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent-teal);
  color: var(--bg-primary);
  padding: 0.5rem 1rem;
  z-index: 1000;
  font-weight: 500;
}
.skip-link:focus {
  top: 0;
}

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 0.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-primary);
  transition: background 0.3s, box-shadow 0.3s;
}

.site-header.scrolled {
  background: #0e1e2a;
  box-shadow: 0 2px 20px rgba(0,0,0,0.3);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-logo img {
  height: 80px;
  width: auto;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  align-self: center;
  margin-top: 0.85rem;
}

.header-nav a {
  color: var(--text-body);
  font-size: 0.9rem;
  font-weight: 400;
  transition: color 0.2s;
}
.header-nav a:hover {
  color: var(--text-heading);
}

.lang-switch {
  display: flex;
  gap: 0.25rem;
  margin-left: 1rem;
  padding-left: 1rem;
  border-left: 1px solid var(--border-subtle);
}
.lang-switch a {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
}
.lang-switch a.active {
  background: var(--accent-teal);
  color: var(--bg-primary);
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0.5rem;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-heading);
  transition: transform 0.3s, opacity 0.3s;
}
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ===== Container ===== */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ===== Section spacing ===== */
section {
  padding: 6rem 0;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.section-subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-bottom: 3rem;
  max-width: 600px;
}

/* ===== Hero ===== */
.hero {
  padding-top: 7rem;
  padding-bottom: 2rem;
  background: linear-gradient(180deg, var(--bg-primary) 0%, #0a1820 100%);
}

/* Hero top: Statement + Portrait */
.hero-top {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  align-items: center;
  margin-bottom: 4rem;
}

.hero-statement h1 {
  font-size: 3rem;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.hero-accent {
  color: var(--accent-teal);
}

.hero-sub {
  font-size: 1.2rem;
  color: var(--text-body);
  max-width: 520px;
}

/* Hero portrait (right) */
.hero-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.hero-portrait-img {
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 16px;
  border: 2px solid var(--border-subtle);
  margin-bottom: 0.75rem;
}

.hero-portrait-label {
  color: var(--text-heading);
  font-size: 1rem;
  font-weight: 500;
}

.hero-portrait-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Simulator section */
.sim-section {
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  padding: 2.5rem;
}

.sim-heading {
  font-size: 1.3rem;
  margin-bottom: 0.4rem;
}

.sim-intro {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 2rem;
}

/* Sim range header: centered */
.sim-range-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.range-display {
  margin-bottom: 0;
}

.sim-range-header .range-bar-container {
  max-width: 400px;
  margin: 0.25rem auto 0;
}

/* Sim grid: vehicle | controls */
.sim-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem;
  align-items: start;
}

.sim-vehicle {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
}

.sim-vehicle .factor-pills {
  position: absolute;
  top: 14px;
  left: 3%;
  margin: 0;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.3rem;
}

.sim-vehicle .factor-pill {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  background: rgba(14, 30, 42, 0.8);
  backdrop-filter: blur(4px);
}

/* Sim footer: centered */
.sim-footer {
  text-align: center;
  margin-top: 1rem;
}

.sim-footer .hero-tagline {
  padding-top: 0;
}

.sim-footer .btn-primary {
  margin-top: 1rem;
}

/* Range display */
.range-display {
  text-align: center;
  margin-bottom: 0;
}

.range-number {
  font-size: 5rem;
  font-weight: 500;
  color: var(--text-heading);
  font-family: 'DM Sans', monospace;
  line-height: 1;
}
.range-unit {
  font-size: 1.5rem;
  color: var(--text-muted);
  font-weight: 300;
}
.range-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Range bar */
.range-bar-container {
  width: 100%;
  height: 8px;
  background: var(--bg-card);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.25rem 0;
}
.range-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease, background 0.4s ease;
}

/* BEV wireframe area */
.bev-display {
  position: relative;
  width: 100%;
  margin: 0 auto 1.5rem;
}

.bev-img {
  width: 100%;
  border-radius: 10px;
  opacity: 0.85;
  object-fit: cover;
  aspect-ratio: 4 / 2.4;
}

.soh-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
  color: var(--text-heading);
}

/* Factor pills */
.factor-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-top: 1rem;
}

.factor-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
}
.factor-pill.negative { border-color: var(--accent-amber); color: var(--accent-amber); }
.factor-pill.positive { border-color: var(--accent-green); color: var(--accent-green); }
.factor-pill.neutral { border-color: var(--text-muted); }

/* Simulator controls */
.sim-controls {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sim-control {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.sim-control label {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.sim-control label .value {
  color: var(--text-heading);
  font-weight: 500;
  font-family: monospace;
}

/* Custom slider */
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: var(--bg-card);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-teal);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px rgba(93, 201, 224, 0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent-teal);
  cursor: pointer;
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 8px rgba(93, 201, 224, 0.4);
}
input[type="range"]:focus {
  outline: 2px solid var(--accent-teal);
  outline-offset: 2px;
}

/* Toggle buttons */
.toggle-group {
  display: flex;
  gap: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
}
.toggle-btn {
  flex: 1;
  padding: 0.5rem 0.8rem;
  background: var(--bg-card);
  color: var(--text-muted);
  border: none;
  font-family: var(--font-primary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.toggle-btn:hover {
  background: var(--bg-hover);
}
.toggle-btn.active {
  background: var(--accent-teal);
  color: var(--bg-primary);
  font-weight: 500;
}
.toggle-btn:focus-visible {
  outline: 2px solid var(--accent-teal);
  outline-offset: -2px;
}

/* Hero tagline */
.hero-tagline {
  text-align: center;
  padding: 0;
  font-size: 1.15rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ===== Case Study ===== */
.case-study {
  background: var(--bg-secondary);
}

.case-steps {
  position: relative;
}

/* Progress line */
.case-steps::before {
  content: '';
  position: absolute;
  left: 20px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border-subtle);
}

.case-step {
  position: relative;
  padding-left: 60px;
  margin-bottom: 4rem;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.case-step.visible {
  opacity: 1;
  transform: translateY(0);
}

.step-dot {
  position: absolute;
  left: 11px;
  top: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2px solid var(--accent-teal);
  z-index: 1;
}

.case-step.visible .step-dot {
  background: var(--accent-teal);
}

.step-number {
  font-size: 0.75rem;
  color: var(--accent-teal);
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.case-step h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.case-step p {
  margin-bottom: 1rem;
  max-width: 640px;
}

/* Case study chart bars */
.chart-bars {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 1.5rem 0;
  max-width: 500px;
}

.chart-bar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.chart-bar-label {
  min-width: 120px;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: right;
}
.chart-bar-track {
  flex: 1;
  height: 24px;
  background: var(--bg-primary);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.chart-bar-value {
  height: 100%;
  border-radius: 4px;
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--bg-primary);
  transition: width 1s ease;
}

/* Key stat highlight */
.key-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border-left: 3px solid var(--accent-amber);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 1rem 0;
  font-size: 0.95rem;
}

.key-stat.positive {
  border-left-color: var(--accent-green);
}

.key-stat strong {
  color: var(--text-heading);
}

/* SOH Chart placeholder */
.soh-chart {
  width: 100%;
  max-width: 500px;
  height: 200px;
  margin: 1.5rem 0;
  background: var(--bg-primary);
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  position: relative;
  overflow: hidden;
}

/* ===== Services ===== */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.service-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 2rem;
  border: 1px solid var(--border-subtle);
  transition: transform 0.3s, border-color 0.3s;
}
.service-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-teal);
}

.service-card .service-icon {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 1.5rem;
}

.service-card h3 {
  font-size: 1.2rem;
  margin-bottom: 1rem;
}

.service-card .challenge,
.service-card .solution {
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.service-card .challenge strong,
.service-card .solution strong {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 0.3rem;
}

.service-card .challenge strong { color: var(--accent-amber); }
.service-card .solution strong { color: var(--accent-green); }

/* ===== Methodology ===== */
.methodology {
  background: var(--bg-secondary);
}

.method-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.method-content img {
  border-radius: 12px;
  width: 100%;
}

.method-points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.method-points li {
  padding-left: 1.5rem;
  position: relative;
  font-size: 0.95rem;
}
.method-points li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 8px;
  height: 8px;
  background: var(--accent-teal);
  border-radius: 50%;
}

/* ===== About ===== */
.about-content {
  display: grid;
  grid-template-columns: 1fr 350px;
  gap: 3rem;
  align-items: start;
}

.about-text p {
  margin-bottom: 1rem;
  font-size: 1rem;
}

.about-portrait {
  border-radius: 12px;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border: 2px solid var(--border-subtle);
}

/* ===== Contact ===== */
.contact {
  background: var(--bg-secondary);
}

.contact-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}

.contact-info p {
  font-size: 1.05rem;
  margin-bottom: 1.5rem;
}

.contact-email {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.1rem;
  color: var(--accent-teal);
  margin-bottom: 2rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--text-heading);
  font-family: var(--font-primary);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent-teal);
}
.contact-form textarea {
  min-height: 120px;
  resize: vertical;
}

/* CTA Button */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--accent-teal);
  color: var(--bg-primary);
  font-family: var(--font-primary);
  font-size: 1rem;
  font-weight: 500;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-primary:hover {
  background: #4bb8cf;
  color: var(--bg-primary);
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}

/* ===== Footer ===== */
.site-footer {
  padding: 2rem 0;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.footer-links {
  display: flex;
  gap: 1.5rem;
}
.footer-links a {
  color: var(--text-muted);
}
.footer-links a:hover {
  color: var(--text-heading);
}

/* ===== Responsive ===== */

/* Tablet hide-br utility */
@media (min-width: 769px) and (max-width: 1024px) {
  .hide-tablet { display: none; }
}

/* Tablet */
@media (max-width: 1024px) {
  .hero-top {
    grid-template-columns: 1fr 220px;
    gap: 2rem;
  }
  .hero-statement h1 {
    font-size: 2.2rem;
  }
  .hero-portrait-img {
    max-width: 220px;
  }
  .sim-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }
  .sim-section {
    padding: 1.25rem 1.5rem;
  }
  .sim-heading {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
  }
  .sim-intro {
    font-size: 0.85rem;
    margin-bottom: 1rem;
  }
  .sim-range-header {
    margin-bottom: 0.75rem;
  }
  .range-number {
    font-size: 3rem;
  }
  .range-label {
    font-size: 0.75rem;
  }
  .sim-control {
    gap: 0.2rem;
  }
  .sim-control label {
    font-size: 0.8rem;
  }
  .sim-controls {
    gap: 1rem;
  }
  .toggle-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }
  .sim-vehicle .factor-pill {
    font-size: 0.68rem;
    padding: 0.15rem 0.45rem;
  }
  .sim-footer {
    margin-top: 0.75rem;
  }
  .hero-tagline {
    font-size: 0.95rem;
    padding-top: 0;
    margin-bottom: 0.5rem;
  }
  .soh-badge {
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
  }

  .services-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }

  .method-content,
  .about-content,
  .contact-content {
    grid-template-columns: 1fr;
  }

  .about-portrait {
    max-width: 300px;
    margin: 0 auto;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .header-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(14, 30, 42, 0.98);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    z-index: 99;
  }
  .header-nav.open {
    display: flex;
  }
  .header-nav a {
    font-size: 1.2rem;
  }

  .hamburger {
    display: flex;
    z-index: 101;
  }

  .lang-switch {
    border-left: none;
    margin-left: 0;
    padding-left: 0;
  }

  section { padding: 4rem 0; }

  .hero { padding-top: 5rem; }
  .hero-top {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
  }
  .hero-portrait {
    order: -1;
  }
  .hero-portrait-img {
    max-width: 180px;
    border-radius: 14px;
  }
  .hero-statement h1 {
    font-size: 1.8rem;
  }
  .hero-sub {
    font-size: 1rem;
    margin: 0 auto;
  }

  .sim-section {
    padding: 1.5rem;
  }
  .sim-grid {
    grid-template-columns: 1fr;
  }

  .site-header {
    padding: 0.5rem 1rem;
    background: #0e1e2a;
  }
  .site-header.scrolled {
    background: #0e1e2a;
  }
  .header-logo img {
    height: 60px;
  }

  .range-number { font-size: 3.5rem; }
  .section-title { font-size: 1.5rem; }

  .case-step { padding-left: 45px; }
  .case-steps::before { left: 14px; }
  .step-dot { left: 5px; width: 16px; height: 16px; }

  .chart-bar-label { min-width: 80px; font-size: 0.78rem; }

  .services-grid {
    grid-template-columns: 1fr;
    max-width: 500px;
    margin: 0 auto;
  }
}

/* Mobile portrait */
@media (max-width: 480px) {
  .container { padding: 0 1rem; }
  .site-header { padding: 0.75rem 1rem; }
  .range-number { font-size: 3rem; }
  .toggle-btn { padding: 0.4rem 0.5rem; font-size: 0.78rem; }
}
