/* ============================================================
   NOMATEC — Modelowanie i projektowanie CAD/CAM
   STYLE: BLUEPRINT
   Rysunek techniczny, siatka pomiarowa
   ============================================================ */

/* --- Animations --- */
@keyframes draw-path {
  from {
    stroke-dashoffset: 800;
    opacity: 0.3;
  }
  to {
    stroke-dashoffset: 0;
    opacity: 1;
  }
}

@keyframes blink-cursor {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* --- Blueprint root --- */
.blueprint {
  background-color: #0A0A0A;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 40px 40px;
}

/* Large grid divisions */
.blueprint--large-grid {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 200px 200px, 200px 200px, 40px 40px, 40px 40px;
}

/* --- Hero --- */
.modelowanie-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.modelowanie-hero__bg {
  position: absolute;
  inset: 0;
  background-image: url('/assets/allphoto/cad_1_opt.webp');
  background-size: cover;
  background-position: center 40%;
  opacity: 0.1;
  z-index: 0;
}

.modelowanie-hero__content {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 2rem;
  padding-top: calc(var(--header-h) + 5rem);
  padding-bottom: 7rem;
}

/* Blueprint "sheet" frame around hero text */
.modelowanie-hero__frame {
  position: relative;
  padding: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  max-width: 780px;
}

/* Corner crosshairs */
.modelowanie-hero__frame::before,
.modelowanie-hero__frame::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border-color: var(--color-red);
  border-style: solid;
}

.modelowanie-hero__frame::before {
  top: -1px;
  left: -1px;
  border-width: 2px 0 0 2px;
}

.modelowanie-hero__frame::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 2px 2px 0;
}

.modelowanie-hero__sheet-label {
  position: absolute;
  top: -1px;
  right: 2rem;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-mid);
  background: #0A0A0A;
  padding: 0 0.5rem;
  transform: translateY(-50%);
}

.modelowanie-hero__doc-num {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-light);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.modelowanie-hero__doc-num::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-mid);
  max-width: 120px;
}

.modelowanie-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--color-white);
  margin-bottom: 1.5rem;
  animation: fade-in-up 0.9s var(--ease) both;
}

.modelowanie-hero__sub {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--color-light);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  animation: fade-in-up 0.9s 0.15s var(--ease) both;
}

.modelowanie-hero__ctas {
  animation: fade-in-up 0.9s 0.3s var(--ease) both;
}

/* --- Animated SVG drawing --- */
.modelowanie-hero__svg-wrap {
  position: absolute;
  right: -2rem;
  top: 50%;
  transform: translateY(-50%);
  width: 380px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 1;
}

.modelowanie-hero__svg-wrap svg path,
.modelowanie-hero__svg-wrap svg circle,
.modelowanie-hero__svg-wrap svg rect,
.modelowanie-hero__svg-wrap svg line {
  stroke-dasharray: 800;
  animation: draw-path 4s ease-in-out forwards;
}

/* --- Section Base --- */
.modelowanie-section {
  padding: 7rem 0;
  position: relative;
}

.modelowanie-section__inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Technical drawing section divider */
.modelowanie-divider {
  position: relative;
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 0;
  overflow: visible;
}

/* Small triangle end caps */
.modelowanie-divider::before,
.modelowanie-divider::after {
  content: '';
  position: absolute;
  top: -3px;
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.modelowanie-divider::before {
  left: 2rem;
  border-right: 7px solid rgba(255, 255, 255, 0.2);
}

.modelowanie-divider::after {
  right: 2rem;
  border-left: 7px solid rgba(255, 255, 255, 0.2);
}

/* --- Blueprint-numbered service blocks --- */
.modelowanie-services {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

.modelowanie-service {
  padding: 3.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
  position: relative;
}

.modelowanie-service:last-child {
  border-bottom: none;
}

/* Cross-hair at start of each service */
.modelowanie-service::before {
  content: '';
  position: absolute;
  left: -2rem;
  top: 3.5rem;
  width: 1rem;
  height: 1px;
  background: var(--color-red);
}

.modelowanie-service__number {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-red);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 0.25rem;
}

.modelowanie-service__number::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-mid);
}

.modelowanie-service__body {}

.modelowanie-service__title {
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.modelowanie-service__text {
  font-family: var(--font-body);
  font-size: clamp(0.9375rem, 1.5vw, 1.05rem);
  color: var(--color-light);
  line-height: 1.75;
  max-width: 600px;
}

/* Animated SVG in service 01 */
.modelowanie-service__drawing {
  margin-top: 2rem;
  opacity: 0.6;
}

.modelowanie-service__drawing svg .draw-path {
  stroke-dasharray: 800;
  stroke-dashoffset: 800;
  animation: draw-path 3s 0.5s ease-out forwards;
}

/* 3D gear mechanism canvas (Three.js — assets/js/gear-scene.js) */
.modelowanie-service__drawing--3d {
  width: 100%;
  max-width: 380px;
  height: 240px;
  margin-top: 1.25rem;
  opacity: 0.85;
}
.gear3d-canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* --- Benefit list in "why us" section --- */
.modelowanie-benefits {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 2px;
  background: rgba(255, 255, 255, 0.05);
  margin-top: 3rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.modelowanie-benefit {
  background: #0A0A0A;
  padding: 2rem;
  position: relative;
  transition: background 0.25s var(--ease);
}

.modelowanie-benefit:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* crosshair corner decoration on hover */
.modelowanie-benefit::before,
.modelowanie-benefit::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-color: var(--color-red);
  border-style: solid;
  opacity: 0;
  transition: opacity 0.25s var(--ease);
}

.modelowanie-benefit::before {
  top: 0; left: 0;
  border-width: 1px 0 0 1px;
}

.modelowanie-benefit::after {
  bottom: 0; right: 0;
  border-width: 0 1px 1px 0;
}

.modelowanie-benefit:hover::before,
.modelowanie-benefit:hover::after {
  opacity: 1;
}

.modelowanie-benefit__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-light);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.modelowanie-benefit__label::before {
  content: '//';
  color: var(--color-red);
  font-weight: 700;
}

.modelowanie-benefit__text {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-light);
  line-height: 1.6;
}

/* --- CTA --- */
.modelowanie-cta {
  padding: 9rem 0;
  text-align: center;
  position: relative;
}

/* Larger grid in CTA */
.modelowanie-cta.blueprint {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 80px 80px;
}

.modelowanie-cta__inner {
  position: relative;
  z-index: 1;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Blueprint frame around CTA */
.modelowanie-cta__frame {
  display: inline-block;
  padding: 4rem 5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  position: relative;
  max-width: 640px;
  width: 100%;
}

.modelowanie-cta__frame::before,
.modelowanie-cta__frame::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-color: var(--color-red);
  border-style: solid;
}

.modelowanie-cta__frame::before {
  top: -1px; left: -1px;
  border-width: 2px 0 0 2px;
}

.modelowanie-cta__frame::after {
  bottom: -1px; right: -1px;
  border-width: 0 2px 2px 0;
}

.modelowanie-cta__eyebrow {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 1.25rem;
  display: block;
}

.modelowanie-cta__title {
  font-family: var(--font-heading);
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 1rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.modelowanie-cta__sub {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-light);
  line-height: 1.6;
  margin-bottom: 2.5rem;
}

/* --- Light variant for services section --- */
.modelowanie-section--light {
  background-color: #f8f8f8 !important;
  background-image:
    linear-gradient(rgba(248,248,248,0.92), rgba(248,248,248,0.92)),
    url('/assets/allphoto/cad_2_opt.webp') !important;
  background-size: cover !important;
  background-position: center !important;
}
.modelowanie-section--light .modelowanie-service {
  border-bottom-color: #e0e0e0;
}
.modelowanie-section--light .modelowanie-service__number { color: rgba(0,0,0,0.25); }
.modelowanie-section--light .modelowanie-service__title { color: var(--color-black); }
.modelowanie-section--light .modelowanie-service__text { color: #555; }
.modelowanie-section--light .modelowanie-benefits {
  background: #e8e8e8;
  border-color: #e0e0e0;
}
.modelowanie-section--light .modelowanie-benefit { background: #ffffff; }
.modelowanie-section--light .modelowanie-benefit:hover { background: #f8f8f8; }
.modelowanie-section--light .modelowanie-benefit__label { color: #777; }

/* --- Responsive --- */
@media (max-width: 900px) {
  .modelowanie-hero__svg-wrap {
    display: none;
  }

  .modelowanie-service {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .modelowanie-service::before {
    display: none;
  }
}

@media (max-width: 768px) {
  .modelowanie-hero__content {
    padding-top: calc(var(--header-h) + 2.5rem);
    padding-bottom: 5rem;
  }

  .modelowanie-hero__title {
    font-size: clamp(2rem, 9.5vw, 3.5rem);
    letter-spacing: 0;
  }

  .modelowanie-hero__frame {
    padding: 2rem 1.5rem;
  }

  .modelowanie-cta__frame {
    padding: 2.5rem 1.5rem;
  }
}

/* Dark service override: remove light backgrounds on service subpages */
.modelowanie-section--light {
  background-color: #0a0a0a !important;
  background-image:
    linear-gradient(rgba(10,10,10,0.9), rgba(10,10,10,0.9)),
    url('/assets/allphoto/cad_2_opt.webp') !important;
}

/* Distinct photo behind the "Dlaczego" blueprint grid */
.modelowanie-section.blueprint {
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(rgba(10,10,10,0.9), rgba(10,10,10,0.82)),
    url('/assets/allphoto/cad_3_opt.webp');
  background-size: 40px 40px, 40px 40px, cover, cover;
  background-position: 0 0, 0 0, center, center;
}
.modelowanie-section--light .modelowanie-service { border-bottom-color: rgba(255,255,255,0.08); }
.modelowanie-section--light .modelowanie-service__number { color: var(--color-red); }
.modelowanie-section--light .modelowanie-service__title { color: var(--color-white); }
.modelowanie-section--light .modelowanie-service__text { color: var(--color-light); }
.modelowanie-section--light .modelowanie-benefits {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.08);
}
.modelowanie-section--light .modelowanie-benefit { background: #101012; }
.modelowanie-section--light .modelowanie-benefit:hover { background: #151518; }
.modelowanie-section--light .modelowanie-benefit__label { color: var(--color-light); }
