@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #080c14;
  --bg-surface: #0e1524;
  --bg-card: #131c2e;
  --bg-card-hover: #18233a;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: #22324b;
  --accent: #d99a3c;
  --accent-hover: #e5a74b;
  --accent-glow: rgba(217, 154, 60, 0.12);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --font-stack: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
  --header-height: 72px;
  --footer-height: 52px;
  --container-max: 1320px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Flexible viewport lock with safe fallback scrolling */
html, body {
  min-height: 100vh;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-stack);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.75rem;
  width: 100%;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
header {
  height: var(--header-height);
  background: rgba(8, 12, 20, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1000;
}

.nav-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
  margin-right: 1.5rem;
}

.logo-mark {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #f5a623 0%, #d99a3c 100%);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #080c14;
  font-size: 1.05rem;
  box-shadow: 0 4px 12px rgba(217, 154, 60, 0.22);
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  line-height: 1.15;
  display: flex;
  flex-direction: column;
}

.logo-text span {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

nav {
  display: flex;
  align-items: center;
  flex: 1;
}

nav ul {
  display: flex;
  list-style: none;
  gap: 0.25rem;
  align-items: center;
  flex-wrap: nowrap;
}

nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.85rem;
  border-radius: 6px;
  white-space: nowrap;
  display: inline-block;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

nav a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

nav a.active {
  color: #ffffff;
  background: var(--accent-glow);
  border-color: rgba(217, 154, 60, 0.35);
  box-shadow: 0 0 14px rgba(217, 154, 60, 0.15);
}

.header-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.25rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.btn-primary {
  background-color: var(--accent);
  color: #080c14;
  border: 1px solid var(--accent);
  box-shadow: 0 4px 12px rgba(217, 154, 60, 0.22);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
}

.btn-outline:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--text-secondary);
}

.mobile-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-medium);
  padding: 0.45rem;
  border-radius: 6px;
  cursor: pointer;
  color: var(--text-primary);
}

/* ==========================================================================
   VIEWPORT SYSTEM WITH SCROLL PROTECTION
   ========================================================================== */
main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

.app-section {
  display: none;
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  width: 100%;
  align-items: center;
  justify-content: center;
  padding: 3rem 0;
  animation: viewFade 0.2s ease-out;
  position: relative;
  overflow-y: auto;
}

.app-section.active-view {
  display: flex;
}

@keyframes viewFade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Controlled Full-Width Atmospheric Layers */
.app-section.has-bg-home {
  background-image: url('assets/hero-bg.svg');
  background-position: center right;
  background-size: cover;
  background-repeat: no-repeat;
}

.app-section.has-bg-logistics {
  background-image: url('assets/logistics-bg.svg');
  background-position: center right;
  background-size: cover;
  background-repeat: no-repeat;
}

.app-section.has-bg-home::before,
.app-section.has-bg-logistics::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    90deg,
    rgba(8, 12, 20, 0.98) 0%,
    rgba(8, 12, 20, 0.90) 44%,
    rgba(8, 12, 20, 0.40) 75%,
    rgba(8, 12, 20, 0.65) 100%
  );
  pointer-events: none;
}

.app-section > .container {
  position: relative;
  z-index: 2;
}

/* Typography & Layout Spacing */
.section-tag {
  color: var(--accent);
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.15em;
  margin-bottom: 0.4rem;
  display: block;
}

.section-title {
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  margin-bottom: 0.5rem;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  max-width: 620px;
  line-height: 1.45;
}

.centered-head {
  text-align: center;
  margin-bottom: 2rem;
}

.centered-head .section-desc {
  margin: 0 auto;
}

/* Hero Section */
.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero h1 {
  font-size: 2.85rem;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.55;
  margin-bottom: 1.5rem;
  max-width: 500px;
}

.hero-ctas {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.hero-subtag {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.1em;
  font-weight: 700;
}

.hero-visual {
  border: 1px solid var(--border-medium);
  background: rgba(14, 21, 36, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
}

/* Category Grid & Cards */
.card-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem 1.35rem;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: rgba(217, 154, 60, 0.4);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card-icon {
  width: 38px;
  height: 38px;
  background: rgba(217, 154, 60, 0.08);
  border: 1px solid rgba(217, 154, 60, 0.2);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.9rem;
}

.card-icon svg {
  width: 20px;
  height: 20px;
  stroke: var(--accent);
  fill: none;
  stroke-width: 1.75;
}

.product-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
}

.product-card ul {
  list-style: none;
  color: var(--text-secondary);
  font-size: 0.82rem;
  margin-bottom: 1.25rem;
}

.product-card li {
  margin-bottom: 0.35rem;
  line-height: 1.35;
}

.card-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 700;
}

/* Diagram & Content Containers */
.diagram-container {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 1.75rem;
  width: 100%;
}

.solutions-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.solution-box {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem 1.25rem;
  border-radius: 8px;
  border-top: 3px solid var(--accent);
}

.solution-box h4 {
  font-size: 1.05rem;
  margin-bottom: 0.5rem;
}

.solution-box p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.editorial-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
  align-items: center;
  width: 100%;
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.why-item {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem;
  border-radius: 8px;
}

.why-item h4 {
  font-size: 1.02rem;
  margin-bottom: 0.35rem;
}

.why-item p {
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.story-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 10px;
  padding: 2.5rem;
  width: 100%;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
  width: 100%;
}

.resource-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: 1.5rem 1.25rem;
  border-radius: 8px;
}

.resource-card h4 {
  font-size: 1.02rem;
  margin-bottom: 0.4rem;
}

.resource-card p {
  color: var(--text-secondary);
  font-size: 0.8rem;
  line-height: 1.45;
  margin-bottom: 1rem;
}

/* Contact & RFQ Unified Module */
.rfq-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 3rem;
  align-items: center;
  width: 100%;
}

.rfq-form-card {
  background: var(--bg-card);
  border: 1px solid var(--border-medium);
  border-radius: 8px;
  padding: 1.75rem;
}

.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.form-group {
  margin-bottom: 0.65rem;
}

.form-group label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
  text-transform: uppercase;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  background: #080c14;
  border: 1px solid var(--border-medium);
  padding: 0.55rem 0.75rem;
  border-radius: 5px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.82rem;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--accent);
}

.form-status {
  padding: 0.65rem;
  border-radius: 5px;
  margin-top: 0.65rem;
  font-size: 0.8rem;
  display: none;
}
.form-status.notice {
  background: rgba(217, 154, 60, 0.1);
  border: 1px solid var(--accent);
  color: var(--accent);
  display: block;
}

/* ==========================================================================
   STATIC FOOTER (height: 52px)
   ========================================================================== */
footer.global-footer {
  height: var(--footer-height);
  border-top: 1px solid var(--border-subtle);
  background: #060910;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 1000;
}

.footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--text-muted);
}

.footer-nav {
  display: flex;
  list-style: none;
  gap: 1.25rem;
  align-items: center;
}

.footer-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
}

.footer-nav a:hover {
  color: var(--accent);
}

.footer-copy {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ==========================================================================
   RESPONSIVE OVERRIDES
   ========================================================================== */
@media (max-width: 1200px) {
  nav ul { gap: 0.15rem; }
  nav a { padding: 0.45rem 0.55rem; font-size: 0.8rem; }
  .brand-logo { margin-right: 0.75rem; }
}

@media (max-width: 1024px) {
  .app-section { padding: 3rem 0; }
  .hero-grid, .editorial-split, .rfq-grid { grid-template-columns: 1fr; gap: 2rem; }
  .card-grid-4, .solutions-grid, .resource-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 900px) {
  .mobile-toggle { display: block; }
  nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: #080c14;
    border-bottom: 1px solid var(--border-subtle);
    padding: 1.25rem 1.75rem;
    display: none;
  }
  nav.active { display: block; }
  nav ul { flex-direction: column; align-items: flex-start; gap: 0.4rem; }
  nav a { width: 100%; padding: 0.65rem 0.85rem; font-size: 0.9rem; }
  .header-actions { display: none; }
  .card-grid-4, .solutions-grid, .resource-grid, .why-grid { grid-template-columns: 1fr; }
  .form-group-row { grid-template-columns: 1fr; }
  .footer-bar { flex-direction: column; gap: 0.4rem; text-align: center; }
  footer.global-footer { height: auto; padding: 1rem 0; }
}

/* Remove unsightly focus rings on programmatic section heading jumps */
h1:focus, h2:focus {
  outline: none !important;
}

/* Expanded Requirements / Notes Textarea */
#orderSpecs {
  min-height: 95px;
}
