/* ============================================
   MILLISEC Landing — Main Styles
   Light theme per §4.1-4.6
   ============================================ */
@import url('variables.css');

/* ----- RESET & BASE ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  font-family: var(--font-heading);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button, input, select, textarea { font: inherit; }

/* ----- SHARED SECTION ----- */
.section {
  padding: var(--section-py) var(--container-px);
  position: relative;
}
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--red);
  margin-bottom: 1rem;
}
.section-title {
  font-size: clamp(1.8rem, 3.5vw, 2.5rem);
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  margin-bottom: 1rem;
}
.section-subtitle {
  font-size: clamp(0.9rem, 1.5vw, 1.05rem);
  color: var(--text-sec);
  max-width: 680px;
  line-height: 1.7;
}

/* Background alternation §4.4 */
.section--alt  { background: var(--bg-alt); }
.section--dark { background: var(--navy); }
.section--dark .section-label  { color: var(--red); }
.section--dark .section-title  { color: #fff; }
.section--dark .section-subtitle { color: rgba(255,255,255,0.7); }

/* ----- BUTTONS ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: var(--btn-radius);
  padding: 0.8rem 1.6rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  gap: 6px;
}
.btn-primary {
  background: var(--red);
  color: #fff;
}
.btn-primary:hover { background: var(--red-dark); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--border);
}
.btn-outline:hover { border-color: var(--navy); }
.btn-telegram {
  background: var(--telegram);
  color: #fff;
}
.btn-telegram:hover { filter: brightness(1.1); }
.btn-full { width: 100%; }

/* ----- NAV §1 ----- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.nav.scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-nav);
}
.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: 64px;
}
.nav-logo img { height: 36px; }
.nav-links {
  display: flex; gap: 2rem;
  margin-left: auto; margin-right: 2rem;
}
.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-sec);
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--navy); }
.nav-cta { margin-right: 1.5rem; }
.nav-cta .btn { padding: 0.55rem 1.2rem; font-size: 0.8rem; }

/* Language switcher */
.lang-switch {
  display: flex; gap: 0.3rem;
  font-size: 0.75rem; font-weight: 500;
}
.lang-switch button {
  background: none; border: none; cursor: pointer;
  padding: 0.3rem 0.5rem; border-radius: 4px;
  color: var(--text-muted);
  transition: all 0.2s;
}
.lang-switch button.active {
  background: var(--bg-alt);
  color: var(--navy);
  font-weight: 600;
}

/* Hamburger */
.hamburger {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 24px; height: 24px;
  position: relative;
}
.hamburger span {
  display: block; width: 20px; height: 2px;
  background: var(--navy); border-radius: 2px;
  position: absolute; left: 2px;
  transition: all 0.3s var(--ease);
}
.hamburger span:nth-child(1) { top: 6px; }
.hamburger span:nth-child(2) { top: 11px; }
.hamburger span:nth-child(3) { top: 16px; }
.hamburger.active span:nth-child(1) { top: 11px; transform: rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { top: 11px; transform: rotate(-45deg); }

/* ----- HERO §2 ----- */
.hero {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  text-align: center;
  padding: 6rem var(--container-px) 3rem;
  overflow: hidden;
  background: var(--bg);
}
.hero-bg { position: absolute; inset: 0; z-index: 0; }
/* Gradient mesh — 3 subtle color blobs for depth */
.hero-grid {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 75% 20%, rgba(233,60,60,0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 20% 80%, rgba(17,29,43,0.04) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 100%, rgba(233,60,60,0.03) 0%, transparent 40%);
}
.hero-glow {
  position: absolute; border-radius: 50%;
  pointer-events: none; filter: blur(100px);
}
.hero-glow--1 {
  width: 700px; height: 700px; right: -5%; top: -10%;
  background: rgba(233,60,60,0.05);
}
.hero-glow--2 {
  width: 500px; height: 500px; left: -5%; bottom: -10%;
  background: rgba(17,29,43,0.04);
}
.hero-content {
  position: relative; z-index: 1;
  max-width: 800px;
}
.hero-title {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--navy);
  margin-bottom: 1.5rem;
}
.text-red { color: var(--red); }
.hero-subtitle {
  font-size: clamp(0.9rem, 1.3vw, 1.05rem);
  color: var(--text-sec);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 650px;
  margin-left: auto; margin-right: auto;
}
.hero-ctas {
  display: flex; gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2.5rem;
}
.trust-badges {
  display: flex; gap: 0.5rem;
  justify-content: center; flex-wrap: wrap;
}
.trust-badges span {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 400;
  color: var(--text-muted);
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  letter-spacing: 0.06em;
}
.hero-scroll {
  position: absolute;
  bottom: 2rem;
  left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center;
  gap: 0.3rem;
  font-size: 0.7rem; color: var(--text-muted);
  opacity: 0.5;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* ----- CARDS (shared) ----- */
.card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.card-icon {
  width: 48px; height: 48px;
  background: var(--red-glow);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1.2rem;
  color: var(--red);
  font-size: 1.3rem;
}
.card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.6rem;
}
.card p {
  font-size: 0.87rem;
  color: var(--text-sec);
  line-height: 1.6;
}
.card-link {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--red);
  transition: color 0.2s;
}
.card-link:hover { color: var(--red-dark); }

/* Cards on dark bg */
.section--dark .card {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
.section--dark .card h3 { color: #fff; }
.section--dark .card p { color: rgba(255,255,255,0.65); }

/* ----- PROBLEM §3 ----- */
.problem-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  margin-top: 2.5rem;
}

/* ----- SOLUTION §4 ----- */
.solution-text {
  margin-bottom: 2.5rem;
}
.solution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
}

/* ----- SERVICES §5 ----- */
.services-header {
  margin-bottom: 2.5rem;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grid-gap);
  margin-bottom: 2rem;
}
.service-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}
.service-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
}
.service-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.4rem;
}
.service-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}
/* Alt bg cards */
.section--alt .service-card { background: #fff; }

/* ----- ORIGIN §6 ----- */
.origin-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: start;
}
.origin-text p {
  font-size: 0.92rem;
  color: var(--text-sec);
  line-height: 1.7;
  margin-bottom: 1.2rem;
}
.trust-grid {
  display: grid;
  gap: 1.5rem;
}
.trust-item {
  padding: 1.2rem;
  background: var(--bg-alt);
  border-radius: var(--card-radius);
  border: 1px solid var(--border-light);
}
.trust-item-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.trust-item-value {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--navy);
}

/* ----- PRODUCTS §7 ----- */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
  margin-top: 2.5rem;
}
.product-card {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.3s var(--ease);
}
.section--alt .product-card { background: #fff; }
.product-card:hover { box-shadow: var(--shadow-card-hover); }
.product-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.product-header h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--navy);
}
.badge {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
}
.badge--green {
  background: rgba(72,187,120,0.1);
  color: #38a169;
}
.badge--blue {
  background: rgba(66,153,225,0.1);
  color: #3182ce;
}
.product-card p {
  font-size: 0.87rem;
  color: var(--text-sec);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}

/* ----- TRAINING §8 ----- */
.training-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}
.training-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--grid-gap);
  margin-top: 2rem;
}
.track-card {
  background: var(--bg-alt);
  border: 1px solid var(--border-light);
  border-radius: var(--card-radius);
  padding: var(--card-pad);
}
.track-meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.track-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 0.6rem;
}
.track-card p {
  font-size: 0.85rem;
  color: var(--text-sec);
  line-height: 1.6;
  margin-bottom: 1.2rem;
}
.training-section { position: relative; }
.training-section::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 50%, rgba(233,60,60,0.02) 0%, transparent 60%);
  pointer-events: none;
}

/* ----- CONTACT §9 (DARK) ----- */
.section--cta {
  background: var(--navy);
  padding: var(--section-py) var(--container-px);
}
.cta-content {
  max-width: 600px;
  margin: 0 auto;
  text-align: center;
}
.section--cta .section-label { color: var(--red); }
.section--cta .section-title { color: #fff; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section--cta .section-subtitle { color: rgba(255,255,255,0.65); margin: 0 auto 2rem; }

.cta-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.form-label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.5);
  text-align: left;
}
.form-label .required { color: var(--red); }

.cta-form input,
.cta-form select,
.cta-form textarea {
  width: 100%;
  padding: 0.7rem 0.9rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--input-radius);
  color: #fff;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.cta-form input::placeholder,
.cta-form textarea::placeholder { color: rgba(255,255,255,0.3); }
.cta-form input:focus,
.cta-form select:focus,
.cta-form textarea:focus { border-color: var(--red); }
.cta-form select { appearance: none; cursor: pointer; }
.cta-form select option { background: var(--navy); color: #fff; }

/* Concern dropdown and Submit span full width */
.cta-form > .form-label:nth-child(n+4),
.cta-form > button {
  grid-column: 1 / -1;
}

.form-divider {
  display: flex; align-items: center; gap: 1rem;
  margin: 1.5rem 0;
  color: rgba(255,255,255,0.3);
  font-size: 0.8rem;
}
.form-divider::before,
.form-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255,255,255,0.1);
}

/* ----- FOOTER §10 (DARK) ----- */
.footer {
  background: var(--navy);
  padding: 4rem var(--container-px) 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 3rem;
}
.footer-logo { height: 40px; margin-bottom: 0.75rem; }
.footer-tagline {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.6);
}
.footer-brand-text {
  font-size: 0.78rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.6;
  margin-top: 0.75rem;
}
.footer-heading {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
  margin-bottom: 1rem;
}
.footer-links li {
  margin-bottom: 0.5rem;
}
.footer-links a,
.footer-contacts li {
  font-size: 0.82rem;
  color: rgba(255,255,255,0.6);
  transition: color 0.2s;
}
.footer-links a:hover { color: #fff; }
.footer-bottom {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.06);
}
.footer-bottom p {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}
.footer-socials {
  display: flex; gap: 1rem;
}
.footer-socials a {
  color: rgba(255,255,255,0.4);
  transition: color 0.2s;
}
.footer-socials a:hover { color: #fff; }
.footer-socials svg { width: 18px; height: 18px; }

/* ----- SCROLL FADE-UP §4.6 ----- */
@media (prefers-reduced-motion: no-preference) {
  .fade-up {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  }
  .fade-up.visible {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----- MOBILE ≤768px ----- */
@media (max-width: 768px) {
  :root {
    --section-py: 4rem;
    --section-px: 1.5rem;
  }

  .nav-links { display: none; }
  .hamburger { display: block; margin-left: auto; margin-right: 1rem; }

  /* Mobile menu */
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px; left: 0; right: 0;
    background: #fff;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    gap: 1rem;
  }

  .hero { min-height: 90vh; padding-top: 5rem; }
  .hero-title { font-size: clamp(1.8rem, 7vw, 2.6rem); }

  .problem-grid,
  .solution-grid { grid-template-columns: 1fr; }

  .services-grid { grid-template-columns: 1fr; }

  .origin-layout { grid-template-columns: 1fr; }

  .products-grid { grid-template-columns: 1fr; }

  .training-grid { grid-template-columns: 1fr; }

  .cta-form { grid-template-columns: 1fr; }
  .cta-form > .form-label:nth-child(n+4),
  .cta-form > button { grid-column: 1; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .hero-ctas { flex-direction: column; }
  .hero-ctas .btn { width: 100%; }
  .trust-badges { gap: 0.35rem; }
}
