/* ============================================================
   Daichin Machinery Svyaz Engineering — Engineering Blueprint
   ============================================================ */

:root {
  --bg: #ffffff;
  --bg-soft: #f5f6f8;
  --bg-grid: #fafbfc;
  --ink: #0f1724;          /* graphite */
  --ink-2: #1f2937;
  --ink-3: #4b5563;
  --muted: #6b7280;
  --line: #e5e7eb;
  --line-2: #d1d5db;
  --accent: #0a2540;       /* deep navy */
  --accent-2: #1e3a5f;
  --blue: #2962ff;         /* blueprint blue */
  --blue-soft: #eaf0ff;
  --warn: #c2410c;
  --radius: 4px;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    linear-gradient(rgba(15,23,36,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15,23,36,0.025) 1px, transparent 1px);
  background-size: 48px 48px;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul, ol { list-style: none; }

.container { max-width: 1240px; margin: 0 auto; padding: 0 32px; }

/* ---------- HEADER ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 72px; gap: 24px;
}
.logo { display: flex; align-items: center; gap: 12px; }
.logo img { width: 36px; height: 36px; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-family: var(--mono); font-size: 12px; font-weight: 600; letter-spacing: 0.08em; }
.logo-sub  { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.06em; margin-top: 2px; }
.main-nav { display: flex; gap: 28px; }
.main-nav a {
  font-size: 14px; color: var(--ink-3); font-weight: 500;
  position: relative; padding: 4px 0; transition: color .2s;
}
.main-nav a:hover { color: var(--ink); }
.main-nav a:hover::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 1px; background: var(--ink);
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; font-size: 14px; font-weight: 600;
  border-radius: var(--radius); transition: all .2s ease;
  font-family: var(--sans); letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.btn-sm { padding: 9px 14px; font-size: 13px; font-family: var(--mono); font-weight: 500; }
.btn-lg { padding: 18px 32px; font-size: 16px; }

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

.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); background: var(--bg-soft); }

.btn-light { background: #fff; color: var(--accent); border-color: #fff; }
.btn-light:hover { background: var(--blue-soft); }

/* ---------- HERO ---------- */
.hero { padding: 80px 0 120px; position: relative; overflow: hidden; }
.hero::before {
  content: 'A-001 / SVYAZ ENGINEERING / DMSE';
  position: absolute; top: 24px; right: 32px;
  font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.15em;
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: 64px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  color: var(--accent); letter-spacing: 0.12em;
  padding: 6px 12px; border: 1px solid var(--line-2); border-radius: 2px;
  background: #fff;
}
.eyebrow .dot { width: 6px; height: 6px; background: var(--blue); border-radius: 50%; }
.eyebrow-light { color: rgba(255,255,255,0.85); border-color: rgba(255,255,255,0.25); background: transparent; }
.eyebrow-light .dot { background: #fff; }

.hero h1 {
  font-size: clamp(36px, 5vw, 64px); line-height: 1.05;
  font-weight: 700; letter-spacing: -0.02em; margin: 22px 0 20px;
  color: var(--ink);
}
.hero .lead {
  font-size: 17px; color: var(--ink-3); max-width: 520px; margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 48px; }
.hero-specs {
  display: flex; flex-direction: column; gap: 10px;
  border-top: 1px solid var(--line); padding-top: 24px;
  font-family: var(--mono); font-size: 13px; color: var(--ink-2);
}
.hero-specs span { color: var(--blue); margin-right: 12px; font-weight: 500; }

.hero-blueprint {
  position: relative; padding: 24px;
  border: 1px solid var(--line); background: var(--bg-grid); border-radius: var(--radius);
}
.hero-blueprint::before {
  content: 'DRAWING · SCALE 1:200'; position: absolute; top: -10px; left: 24px;
  background: #fff; padding: 0 8px;
  font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.12em;
}

/* ---------- SECTION ---------- */
.section { padding: 110px 0; border-top: 1px solid var(--line); }
.section-head { max-width: 760px; margin-bottom: 64px; }
.sec-num {
  font-family: var(--mono); font-size: 12px; color: var(--blue);
  letter-spacing: 0.12em; margin-bottom: 16px;
}
.section-head h2 {
  font-size: clamp(28px, 3.4vw, 44px); line-height: 1.1;
  font-weight: 700; letter-spacing: -0.02em; margin-bottom: 16px;
}
.sec-desc { color: var(--ink-3); font-size: 16px; max-width: 620px; }

/* ---------- STATS ---------- */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: #fff;
}
.stat {
  padding: 40px 32px; position: relative;
  border-right: 1px solid var(--line);
}
.stat:last-child { border-right: none; }
.stat::before {
  content: ''; position: absolute; top: 16px; left: 32px; right: 32px;
  height: 1px; background: var(--line);
}
.stat-num {
  font-family: var(--mono); font-size: 56px; font-weight: 500;
  color: var(--ink); letter-spacing: -0.02em; line-height: 1;
  display: inline-block;
}
.stat-unit {
  display: inline-block; margin-left: 6px;
  font-family: var(--mono); font-size: 18px; color: var(--blue); font-weight: 500;
  vertical-align: top; margin-top: 8px;
}
.stat-label { color: var(--ink-3); font-size: 14px; margin-top: 16px; line-height: 1.5; }

/* ---------- DIRECTIONS ---------- */
.direction-list { display: flex; flex-direction: column; }
.direction-item {
  display: grid; grid-template-columns: 80px 100px 1fr; gap: 32px;
  padding: 40px 0; border-top: 1px solid var(--line); align-items: start;
  transition: background .2s;
}
.direction-item:last-child { border-bottom: 1px solid var(--line); }
.direction-item:hover { background: var(--bg-grid); }
.dir-index { font-family: var(--mono); font-size: 14px; color: var(--blue); padding-top: 4px; }
.dir-icon {
  width: 88px; height: 88px; border: 1px solid var(--line);
  border-radius: var(--radius); display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.dir-icon img { width: 52px; height: 52px; }
.dir-body h3 {
  font-size: 24px; font-weight: 600; margin-bottom: 12px; letter-spacing: -0.01em;
}
.dir-body p { color: var(--ink-3); max-width: 720px; margin-bottom: 18px; }
.dir-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.dir-tags li {
  font-family: var(--mono); font-size: 11px; padding: 5px 10px;
  border: 1px solid var(--line-2); border-radius: 2px; color: var(--ink-2);
  background: #fff;
}

/* ---------- SERVICES / TABS ---------- */
.tabs { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; overflow: hidden; }
.tab-buttons { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
.tab-btn {
  padding: 28px 32px; text-align: left; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 6px;
  transition: background .2s; position: relative;
}
.tab-btn:last-child { border-right: none; }
.tab-btn:hover { background: var(--bg-grid); }
.tab-btn.active { background: var(--accent); color: #fff; }
.tab-btn.active .tab-idx { color: var(--blue-soft); }
.tab-idx { font-family: var(--mono); font-size: 12px; color: var(--blue); letter-spacing: 0.1em; }
.tab-name { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; }

.tab-content { display: none; padding: 48px; }
.tab-content.active { display: grid; grid-template-columns: 1fr 1.4fr; gap: 48px; }
.tab-lead h3 { font-size: 22px; font-weight: 600; margin-bottom: 12px; letter-spacing: -0.01em; }
.tab-lead p { color: var(--ink-3); }

.steps-list { counter-reset: stepcount; display: flex; flex-direction: column; }
.steps-list li {
  display: grid; grid-template-columns: 36px 1fr; gap: 20px;
  padding: 18px 0; border-top: 1px solid var(--line);
  color: var(--ink-3); font-size: 15px; align-items: start;
  counter-increment: stepcount;
}
.steps-list li:first-child { border-top: none; padding-top: 0; }
.steps-list li::before {
  content: counter(stepcount, decimal-leading-zero);
  font-family: var(--mono); font-size: 13px; color: var(--blue); padding-top: 2px;
}
.steps-list li b { color: var(--ink); font-weight: 600; }

/* ---------- TIMELINE ---------- */
.timeline {
  position: relative; display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 16px; padding-top: 40px;
}
.timeline-track {
  position: absolute; top: 60px; left: 5%; right: 5%;
  height: 1px; background: var(--line);
  background-image: linear-gradient(to right, var(--line-2) 50%, transparent 50%);
  background-size: 12px 1px;
}
.timeline-step { text-align: center; padding: 0 8px; position: relative; }
.ts-node {
  width: 40px; height: 40px; border-radius: 50%;
  background: #fff; border: 1px solid var(--ink); color: var(--ink);
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px; position: relative; z-index: 1;
  transition: all .25s;
}
.timeline-step:hover .ts-node { background: var(--accent); color: #fff; border-color: var(--accent); transform: scale(1.08); }
.ts-title { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.ts-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }

/* ---------- CERTIFICATES ---------- */
.cert-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px;
  background: var(--line); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
}
.cert-card {
  background: #fff; padding: 36px 28px;
  display: flex; flex-direction: column; gap: 14px;
  transition: background .2s;
}
.cert-card:hover { background: var(--bg-grid); }
.cert-card img { width: 56px; height: 56px; }
.cert-card h4 { font-size: 17px; font-weight: 600; letter-spacing: -0.005em; }
.cert-card p { font-size: 14px; color: var(--ink-3); line-height: 1.55; }

/* ---------- CONTACTS ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.contact-card {
  display: block; padding: 36px 32px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  transition: all .2s; position: relative;
}
.contact-card:hover:not(.static) {
  border-color: var(--ink); transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15,23,36,0.06);
}
.cc-label {
  font-family: var(--mono); font-size: 11px; color: var(--blue);
  letter-spacing: 0.12em; margin-bottom: 16px; text-transform: uppercase;
}
.cc-value { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; word-break: break-word; }
.cc-meta { font-size: 13px; color: var(--muted); }

/* ---------- CTA ---------- */
.cta {
  background: var(--accent);
  color: #fff; padding: 80px 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}
.cta-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 48px; flex-wrap: wrap;
}
.cta-text { max-width: 620px; }
.cta-text h2 {
  font-size: clamp(28px, 3.4vw, 42px); font-weight: 700;
  letter-spacing: -0.02em; line-height: 1.1; margin: 18px 0 14px;
}
.cta-text p { color: rgba(255,255,255,0.75); font-size: 16px; }

/* ---------- FOOTER ---------- */
.site-footer {
  background: #0a0e17; color: rgba(255,255,255,0.7);
  padding: 64px 0 32px;
}
.footer-grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px;
  padding-bottom: 48px; border-bottom: 1px solid rgba(255,255,255,0.08);
}
.footer-brand { display: flex; gap: 14px; align-items: center; }
.footer-brand img { width: 42px; height: 42px; filter: invert(1); }
.footer-brand .logo-name { color: #fff; font-size: 13px; }
.footer-brand .logo-sub { color: rgba(255,255,255,0.5); font-size: 11px; }
.fc-title {
  font-family: var(--mono); font-size: 11px; color: rgba(255,255,255,0.4);
  letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 16px;
}
.fc-link {
  display: block; font-size: 14px; padding: 4px 0;
  color: rgba(255,255,255,0.7); transition: color .2s;
}
.fc-link:hover { color: #fff; }
.fc-link.strong { color: #fff; font-weight: 600; font-size: 17px; margin-bottom: 6px; }
.fc-link.muted { color: rgba(255,255,255,0.4); }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 980px) {
  .main-nav { display: none; }
  .hero { padding: 56px 0 80px; }
  .hero-grid { grid-template-columns: 1fr; gap: 48px; }
  .section { padding: 80px 0; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(2) { border-right: none; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .direction-item { grid-template-columns: 60px 1fr; }
  .direction-item .dir-icon { display: none; }
  .tab-content.active { grid-template-columns: 1fr; gap: 32px; padding: 32px; }
  .timeline { grid-template-columns: 1fr; gap: 24px; }
  .timeline-track { display: none; }
  .timeline-step { display: grid; grid-template-columns: 60px 1fr; text-align: left; gap: 16px; align-items: center; }
  .ts-node { margin: 0; }
  .cert-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .cta-inner { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 560px) {
  .container { padding: 0 20px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stat { border-right: none !important; border-bottom: 1px solid var(--line); }
  .stat:last-child { border-bottom: none; }
  .stat-num { font-size: 44px; }
  .cert-grid { grid-template-columns: 1fr; }
  .tab-buttons { grid-template-columns: 1fr; }
  .tab-btn { border-right: none; border-bottom: 1px solid var(--line); }
  .tab-name { font-size: 18px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .header-inner { height: 64px; }
  .logo-text { display: none; }
}

/* ============================================================
   DYNAMIC LAYER — gradient blobs, reveals, motion, hover fx
   ============================================================ */

/* Floating gradient blobs (placed inside sections with .has-fx) */
.has-fx { position: relative; overflow: hidden; isolation: isolate; }
.fx-blob {
  position: absolute; z-index: -1; pointer-events: none;
  border-radius: 50%; filter: blur(80px); opacity: .55;
  will-change: transform;
  animation: blobFloat 18s ease-in-out infinite;
}
.fx-blob.b1 { width: 520px; height: 520px;
  background: radial-gradient(circle at 30% 30%, #2962ff 0%, rgba(41,98,255,0) 70%);
  top: -120px; left: -120px; }
.fx-blob.b2 { width: 460px; height: 460px;
  background: radial-gradient(circle at 70% 40%, #7c3aed 0%, rgba(124,58,237,0) 70%);
  bottom: -160px; right: -100px; animation-delay: -6s; animation-duration: 22s; }
.fx-blob.b3 { width: 360px; height: 360px;
  background: radial-gradient(circle at 50% 50%, #06b6d4 0%, rgba(6,182,212,0) 70%);
  top: 40%; right: 20%; opacity: .35; animation-delay: -12s; animation-duration: 26s; }
.fx-blob.b-dark { opacity: .25; mix-blend-mode: screen; }

@keyframes blobFloat {
  0%,100% { transform: translate(0,0) scale(1); }
  33%     { transform: translate(60px,-40px) scale(1.08); }
  66%     { transform: translate(-40px,50px) scale(.95); }
}

/* Animated blueprint grid sheen */
.fx-grid-sheen::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(115deg, transparent 30%, rgba(41,98,255,.07) 50%, transparent 70%);
  background-size: 250% 250%;
  animation: sheen 9s linear infinite;
}
@keyframes sheen {
  0% { background-position: 200% 0; }
  100% { background-position: -100% 0; }
}

/* Scroll-reveal */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.delay-1 { transition-delay: .08s; }
.reveal.delay-2 { transition-delay: .16s; }
.reveal.delay-3 { transition-delay: .24s; }
.reveal.delay-4 { transition-delay: .32s; }

/* Card hover lift */
.dir-card, .svc-card, .cert-card, .contact-card, .stat-card, .timeline-step {
  transition: transform .45s cubic-bezier(.2,.7,.2,1), box-shadow .45s, border-color .45s, background .45s;
}
.dir-card:hover, .svc-card:hover, .cert-card:hover, .contact-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 50px -20px rgba(41,98,255,.35), 0 8px 20px -10px rgba(15,23,36,.15);
  border-color: rgba(41,98,255,.45) !important;
}
.dir-card::before, .svc-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(135deg, rgba(41,98,255,.08), transparent 60%);
  opacity: 0; transition: opacity .45s;
}
.dir-card, .svc-card { position: relative; }
.dir-card:hover::before, .svc-card:hover::before { opacity: 1; }

/* Icon pop */
.dir-icon, .svc-icon { transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.dir-card:hover .dir-icon, .svc-card:hover .svc-icon { transform: scale(1.12) rotate(-4deg); }

/* Buttons — glow + shine */
.btn { position: relative; overflow: hidden; transition: transform .3s, box-shadow .3s, background .3s; }
.btn-primary { box-shadow: 0 6px 20px -6px rgba(41,98,255,.55); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(41,98,255,.75); }
.btn::after {
  content: ""; position: absolute; top: 0; left: -120%; width: 60%; height: 100%;
  background: linear-gradient(110deg, transparent, rgba(255,255,255,.45), transparent);
  transform: skewX(-20deg);
  transition: left .7s ease;
}
.btn:hover::after { left: 130%; }

/* Hero floating accent */
.hero-blueprint { animation: floatY 7s ease-in-out infinite; }
@keyframes floatY {
  0%,100% { transform: translateY(0); }
  50%     { transform: translateY(-14px); }
}

/* Pulse dot */
.eyebrow .dot {
  position: relative;
  box-shadow: 0 0 0 0 rgba(41,98,255,.6);
  animation: pulseDot 2.2s ease-out infinite;
}
@keyframes pulseDot {
  0% { box-shadow: 0 0 0 0 rgba(41,98,255,.55); }
  70%{ box-shadow: 0 0 0 12px rgba(41,98,255,0); }
  100%{box-shadow: 0 0 0 0 rgba(41,98,255,0); }
}

/* Animated underline links in nav */
.site-nav a { position: relative; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 2px;
  background: var(--blue); transform: scaleX(0); transform-origin: right;
  transition: transform .35s cubic-bezier(.2,.7,.2,1);
}
.site-nav a:hover::after { transform: scaleX(1); transform-origin: left; }

/* Marquee for stats / specs */
@keyframes ticker {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fx-blob, .hero-blueprint, .eyebrow .dot, .fx-grid-sheen::after { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}
