/* ============================================================
   NOMATEC — Toczenie CNC
   STYLE: ROTATION / CYLINDER
   Motyw obrotu, walca, koncentryczności
   ============================================================ */

/* --- Animations --- */
@keyframes spin-slow {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes spin-reverse {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(-360deg); }
}

@keyframes pulse-ring {
  0%   { opacity: 0.15; transform: translate(-50%, -50%) scale(1); }
  50%  { opacity: 0.35; transform: translate(-50%, -50%) scale(1.04); }
  100% { opacity: 0.15; transform: translate(-50%, -50%) scale(1); }
}

@keyframes float-card {
  0%   { transform: perspective(600px) rotateY(0deg) translateY(0); }
  50%  { transform: perspective(600px) rotateY(0deg) translateY(-4px); }
  100% { transform: perspective(600px) rotateY(0deg) translateY(0); }
}

/* --- Hero --- */
.toczenie-hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  background: linear-gradient(90deg, #0A0A0A 0%, #1A1A1C 40%, #0A0A0A 100%);
}

.toczenie-hero__bg {
  position: absolute;
  inset: 0;
  background-image: url('/assets/Toczenie/nomatec-toczenie-cnc.webp');
  background-size: cover;
  background-position: center;
  opacity: 0.18;
  z-index: 0;
}

/* Rotating SVG rings in background */
.toczenie-hero__rings {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.toczenie-ring {
  position: absolute;
  top: 50%;
  left: 55%;
  border-radius: 50%;
  border: 1px solid var(--color-red);
}

.toczenie-ring--1 {
  width: 600px;
  height: 600px;
  opacity: 0.12;
  animation: spin-slow 30s linear infinite;
  border-width: 2px;
  border-style: solid;
  border-color: var(--color-red);
}

.toczenie-ring--2 {
  width: 440px;
  height: 440px;
  opacity: 0.18;
  animation: spin-reverse 20s linear infinite;
  border-style: dashed;
}

.toczenie-ring--3 {
  width: 280px;
  height: 280px;
  opacity: 0.25;
  animation: spin-slow 14s linear infinite;
  border-width: 3px;
}

.toczenie-ring--4 {
  width: 120px;
  height: 120px;
  opacity: 0.5;
  animation: spin-reverse 8s linear infinite;
  border-width: 2px;
}

.toczenie-ring--pulse {
  width: 700px;
  height: 700px;
  opacity: 0.08;
  border-width: 40px;
  border-color: var(--color-red);
  animation: pulse-ring 5s ease-in-out infinite;
}

.toczenie-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) + 4rem);
  padding-bottom: 6rem;
}

.toczenie-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 1.5rem;
}

.toczenie-hero__label::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 2px;
  background: var(--color-red);
}

.toczenie-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2.8rem, 7vw, 5.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.0;
  color: var(--color-white);
  max-width: 900px;
  margin-bottom: 1.5rem;
}

.toczenie-hero__title em {
  font-style: normal;
  color: var(--color-red);
}

.toczenie-hero__title-line {
  white-space: nowrap;
}

.toczenie-hero__sub {
  font-family: var(--font-body);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
  color: var(--color-light);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 3rem;
}

.toczenie-hero__ctas {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

/* --- Section Base for Toczenie --- */
.toczenie-section {
  padding: 6rem 0;
  position: relative;
}

.toczenie-section--cylinder {
  background: linear-gradient(90deg, #0A0A0A 0%, #1A1A1C 45%, #0A0A0A 100%);
}

.toczenie-section--black {
  background-color: var(--color-black);
}

.toczenie-section__inner {
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 2rem;
}

/* Section heading with circular decoration */
.toczenie-section__heading {
  position: relative;
  display: inline-block;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.75rem;
  padding-left: 3rem;
}

.toczenie-section__heading::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 2px solid var(--color-red);
  background: transparent;
}

.toczenie-section__heading::after {
  content: '';
  position: absolute;
  left: 0.375rem;
  top: 50%;
  transform: translateY(-50%);
  width: 1.25rem;
  height: 1.25rem;
  border-radius: 50%;
  background: var(--color-red);
  opacity: 0.35;
}

.toczenie-section__sub {
  font-family: var(--font-body);
  color: var(--color-light);
  font-size: 1.05rem;
  margin-bottom: 3.5rem;
  padding-left: 3rem;
}

/* --- 3D Benefit Cards --- */
.toczenie-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.toczenie-card {
  background: var(--color-dark);
  border: 1px solid var(--color-mid);
  padding: 2.5rem 2rem;
  position: relative;
  transition: transform 0.4s var(--ease), border-color 0.3s var(--ease), box-shadow 0.4s var(--ease);
  animation: float-card 6s ease-in-out infinite;
}

.toczenie-card:nth-child(2) { animation-delay: -2s; }
.toczenie-card:nth-child(3) { animation-delay: -4s; }

.toczenie-card:hover {
  transform: perspective(600px) rotateY(5deg) translateY(-6px);
  border-color: var(--color-red);
  box-shadow: -8px 12px 40px rgba(255, 16, 28, 0.15);
  animation: none;
}

.toczenie-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--color-red);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
  color: var(--color-red);
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  flex-shrink: 0;
}

.toczenie-card__title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.toczenie-card__text {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  color: var(--color-light);
  line-height: 1.6;
}

/* --- Specs — Dial/Gauge Cards --- */
.toczenie-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.toczenie-spec-block {
  background: var(--color-dark);
  border: 1px solid var(--color-mid);
  padding: 2.5rem;
  position: relative;
}

.toczenie-spec-block__title {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.toczenie-spec-block__title::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-red);
  flex-shrink: 0;
}

.toczenie-gauges {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.toczenie-gauge {
  flex: 1;
  min-width: 120px;
  background: var(--color-black);
  border: 2px solid var(--color-mid);
  border-radius: 50%;
  width: 140px;
  height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  text-align: center;
  transition: border-color 0.3s var(--ease);
  flex-shrink: 0;
}

.toczenie-gauge:hover {
  border-color: var(--color-red);
}

.toczenie-gauge__value {
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-white);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.toczenie-gauge__label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-light);
  line-height: 1.3;
  text-align: center;
}

/* --- Materials Pills --- */
.toczenie-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.toczenie-section--materials .toczenie-section__inner {
  max-width: var(--max-w);
}

.toczenie-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border: 1px solid var(--color-mid);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-light);
  border-radius: 50px;
  transition: all 0.25s var(--ease);
}

.toczenie-pill:hover {
  border-color: var(--color-red);
  color: var(--color-white);
  background: rgba(255, 16, 28, 0.08);
}

@media (min-width: 1180px) {
  .toczenie-section--materials .toczenie-materials {
    flex-wrap: nowrap;
    gap: clamp(0.45rem, 0.65vw, 0.75rem);
  }

  .toczenie-section--materials .toczenie-pill {
    padding-inline: clamp(0.85rem, 0.85vw, 1.2rem);
    white-space: nowrap;
  }
}

/* --- CTA Section --- */
.toczenie-cta {
  padding: 8rem 0;
  background:
    linear-gradient(90deg, rgba(10,10,10,0.96) 0%, rgba(26,26,28,0.88) 40%, rgba(10,10,10,0.96) 100%),
    url('/assets/allphoto/toczenie_1_opt.webp');
  background-size: cover;
  background-position: center;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.toczenie-cta::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  border: 60px solid rgba(255, 16, 28, 0.05);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.toczenie-cta__inner {
  position: relative;
  z-index: 1;
  max-width: var(--content-w);
  margin: 0 auto;
  padding: 0 2rem;
}

.toczenie-cta__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3.5rem);
  font-weight: 700;
  color: var(--color-white);
  margin-bottom: 1rem;
}

.toczenie-cta__sub {
  font-family: var(--font-body);
  color: var(--color-light);
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

/* --- Light section variant --- */
.toczenie-section--light {
  background-color: #f8f8f8;
  background-image:
    linear-gradient(rgba(248,248,248,0.93), rgba(248,248,248,0.93)),
    url('/assets/allphoto/toczenie_2_opt.webp');
  background-size: cover;
  background-position: center;
  border-top: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
}
.toczenie-section--light .toczenie-section__heading { color: var(--color-black); }
.toczenie-section--light .toczenie-section__heading::before { border-color: var(--color-red); background: #f8f8f8; }
.toczenie-section--light .toczenie-section__heading::after { background: var(--color-red); opacity: 0.3; }
.toczenie-section--light .toczenie-section__sub { color: #555; }

.toczenie-section--light .toczenie-card {
  background: #ffffff;
  border-color: #e0e0e0;
  animation: none;
}
.toczenie-section--light .toczenie-card:hover {
  border-color: var(--color-red);
  box-shadow: 0 6px 32px rgba(255,16,28,0.1);
  transform: translateY(-4px);
}
.toczenie-section--light .toczenie-card__title { color: var(--color-black); }
.toczenie-section--light .toczenie-card__text { color: #555; }

.toczenie-section--light .toczenie-pill {
  border-color: #d0d0d0;
  color: #333;
  background: #ffffff;
}
.toczenie-section--light .toczenie-pill:hover {
  border-color: var(--color-red);
  color: var(--color-red);
  background: rgba(255,16,28,0.04);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .toczenie-hero__content {
    padding-top: calc(var(--header-h) + 2rem);
    padding-bottom: 4rem;
  }

  .toczenie-hero__title {
    font-size: clamp(2rem, 9.8vw, 4.5rem);
    letter-spacing: 0;
    max-width: 100%;
  }

  .toczenie-hero__title-line {
    white-space: normal;
  }

  .toczenie-ring--1 { width: 320px; height: 320px; }
  .toczenie-ring--2 { width: 220px; height: 220px; }
  .toczenie-ring--3 { width: 140px; height: 140px; }
  .toczenie-ring--4 { width: 60px;  height: 60px;  }
  .toczenie-ring--pulse { width: 380px; height: 380px; }

  .toczenie-hero__rings .toczenie-ring {
    left: 50%;
  }

  .toczenie-gauges {
    justify-content: center;
  }

  .toczenie-card:hover {
    transform: translateY(-4px);
  }
}

/* Dark service override: remove light backgrounds on service subpages */
.toczenie-section--light {
  background-color: #0d0d0f;
  background-image:
    linear-gradient(rgba(10,10,10,0.9), rgba(10,10,10,0.9)),
    url('/assets/allphoto/toczenie_2_opt.webp');
  border-top-color: rgba(255,255,255,0.08);
  border-bottom-color: rgba(255,255,255,0.08);
}
.toczenie-section--light .toczenie-section__heading { color: var(--color-white); }
.toczenie-section--light .toczenie-section__heading::before { background: #0d0d0f; }
.toczenie-section--light .toczenie-section__sub { color: var(--color-light); }
.toczenie-section--light .toczenie-card {
  background: #141416;
  border-color: rgba(255,255,255,0.08);
}
.toczenie-section--light .toczenie-card:hover {
  border-color: var(--color-red);
  box-shadow: 0 12px 36px rgba(255,16,28,0.14);
}
.toczenie-section--light .toczenie-card__title { color: var(--color-white); }
.toczenie-section--light .toczenie-card__text { color: var(--color-light); }
.toczenie-section--light .toczenie-pill {
  background: rgba(255,255,255,0.03);
  border-color: rgba(255,255,255,0.12);
  color: var(--color-light);
}
.toczenie-section--light .toczenie-pill:hover {
  background: rgba(255,16,28,0.08);
  color: var(--color-white);
}
