/* Buta Machinery — shared UI */

.material-symbols-outlined {
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  display: inline-block;
  vertical-align: middle;
}

.material-symbols-outlined.fill,
.symbol-filled,
.icon-fill {
  font-variation-settings: "FILL" 1, "wght" 400, "GRAD" 0, "opsz" 24;
}

/* Scroll reveal — appear on scroll down, hide (reverse) on scroll up */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

.reveal.reveal-left {
  transform: translateX(-32px);
}

.reveal.reveal-right {
  transform: translateX(32px);
}

.reveal.reveal-scale {
  transform: scale(0.96);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Scroll-up hide: reverse direction from scroll-down enter */
.reveal.is-leaving {
  opacity: 0;
  transform: translateY(-28px);
}

.reveal.reveal-left.is-leaving {
  transform: translateX(32px);
}

.reveal.reveal-right.is-leaving {
  transform: translateX(-32px);
}

.reveal.reveal-scale.is-leaving {
  transform: scale(0.96);
}

.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .reveal.is-leaving {
    opacity: 1;
    transform: none;
  }
}

/* Header */
.site-header {
  transition: box-shadow 0.3s ease, background-color 0.3s ease;
}

.site-header.is-scrolled {
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 8px 24px rgba(234, 29, 0, 0.08);
  background-color: rgba(251, 249, 248, 0.96);
  backdrop-filter: blur(8px);
}

/* Mobile drawer */
.mobile-nav {
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-nav.is-open {
  transform: translateX(0);
}

.mobile-nav-backdrop {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.mobile-nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Cards & hover */
.service-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.product-card {
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    box-shadow 0.3s ease;
}

.product-card.is-hidden {
  display: none;
}

.product-card.is-filtering-out {
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}

/* Hero entrance */
.hero-enter {
  animation: heroFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-enter-delay {
  animation: heroFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both;
}

.hero-enter-delay-2 {
  animation: heroFadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) 0.3s both;
}

@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-enter,
  .hero-enter-delay,
  .hero-enter-delay-2 {
    animation: none;
  }
}

/* Technical grid background */
.technical-grid {
  background-size: 40px 40px;
  background-image: radial-gradient(circle, #e5e7eb 1px, transparent 1px);
}

.hero-overlay {
  background: linear-gradient(90deg, rgba(234, 29, 0, 0.88) 0%, rgba(27, 28, 28, 0.45) 100%);
}

.bento-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 24px;
}

.custom-scrollbar::-webkit-scrollbar {
  width: 4px;
}

.custom-scrollbar::-webkit-scrollbar-track {
  background: #f8f9fa;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
  background: #c4c6d4;
  border-radius: 4px;
}

/* FAB hover */
.fab-stack a {
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.fab-stack a:hover {
  transform: scale(1.08);
}

/* Filter empty state */
.filter-empty {
  display: none;
}

.filter-empty.is-visible {
  display: flex;
}

/* —— Device preview (PC ↔ Mobile demo) —— */
.device-switcher {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 90;
  display: none;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #EA1D00;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(234, 29, 0, 0.28);
}

@media (min-width: 900px) {
  .device-switcher {
    display: flex;
  }
}

.device-switcher button {
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  transition: background 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.device-switcher button:hover {
  color: #fff;
}

.device-switcher button.is-active {
  background: #F5C518;
  color: #1b1c1c;
}

.device-switcher .material-symbols-outlined {
  font-size: 18px;
}

.device-preview {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 197, 24, 0.14), transparent 40%),
    #1b1c1c;
  padding: 24px;
}

.device-preview.is-open {
  display: flex;
}

.device-preview__frame {
  position: relative;
  width: min(390px, calc(100vw - 48px));
  height: min(844px, calc(100vh - 48px));
  background: #111;
  border-radius: 36px;
  padding: 12px;
  box-shadow:
    0 0 0 2px #303030,
    0 24px 80px rgba(0, 0, 0, 0.55);
  animation: devicePop 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.device-preview__notch {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 28px;
  background: #111;
  border-radius: 0 0 16px 16px;
  z-index: 2;
  pointer-events: none;
}

.device-preview__iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 26px;
  background: #fbf9f8;
  display: block;
}

.device-preview__hint {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: 0.04em;
  pointer-events: none;
}

@keyframes devicePop {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .device-preview__frame {
    animation: none;
  }
}

/* Inside iframe embed: no outer chrome duplication needed */
html.is-device-embed .device-switcher,
html.is-device-embed .device-preview {
  display: none !important;
}

/* Careers hiring-mode demo toggle (top-left PC + Mobile) */
.hiring-switcher {
  position: fixed;
  left: 16px;
  top: 96px;
  z-index: 85;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: #1b1c1c;
  border-radius: 8px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.22);
}

@media (min-width: 768px) {
  .hiring-switcher {
    left: 24px;
    top: 104px;
  }
}

.hiring-switcher button {
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  transition: background 0.2s ease, color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.hiring-switcher button:hover {
  color: #fff;
}

.hiring-switcher button.is-active {
  background: #EA1D00;
  color: #fff;
}

.hiring-switcher button.is-active[data-hiring="closed"] {
  background: #F5C518;
  color: #1b1c1c;
}

.hiring-switcher .material-symbols-outlined {
  font-size: 16px;
}

.jobs-empty-state {
  display: none;
}

.jobs-empty-state.is-visible {
  display: block;
}

[data-hiring-open] {
  display: none;
}

[data-hiring-open].is-visible {
  display: block;
}

html.is-device-embed .hiring-switcher {
  display: none !important;
}

/* —— CMS cards (services grid, TAT-style) —— */
.cms-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #E5E7EB;
  border-radius: 0.75rem;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.cms-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(234, 29, 0, 0.1);
  border-color: #ffb4a8;
}

.cms-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  background: #f5f3f3;
  overflow: hidden;
}

.cms-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.cms-card:hover .cms-card__media img {
  transform: scale(1.05);
}

.cms-card__icon {
  position: absolute;
  left: 16px;
  bottom: 16px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #EA1D00;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(234, 29, 0, 0.35);
}

.cms-card__body {
  padding: 20px 20px 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.cms-card__title {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 20px;
  font-weight: 600;
  line-height: 28px;
  color: #EA1D00;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.cms-card:hover .cms-card__title {
  color: #b81600;
}

.cms-card__excerpt {
  font-family: Inter, sans-serif;
  font-size: 15px;
  line-height: 24px;
  color: #5f5e5e;
  margin-bottom: 16px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.cms-card__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #EA1D00;
}

.cms-card:hover .cms-card__more {
  color: #F5C518;
}

/* —— News list rows —— */
.news-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  padding: 24px 0;
  border-bottom: 1px solid #E5E7EB;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease;
}

@media (min-width: 768px) {
  .news-row {
    grid-template-columns: 240px 1fr;
    gap: 28px;
    align-items: center;
  }
}

.news-row:hover .news-row__title {
  color: #EA1D00;
}

.news-row__media {
  aspect-ratio: 16 / 10;
  border-radius: 0.75rem;
  overflow: hidden;
  background: #f5f3f3;
}

.news-row__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.news-row:hover .news-row__media img {
  transform: scale(1.04);
}

.news-row__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: #747683;
}

.news-row__cat {
  background: #ffe8e4;
  color: #EA1D00;
  padding: 2px 10px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.news-row__title {
  font-family: "Hanken Grotesk", sans-serif;
  font-size: 22px;
  font-weight: 600;
  line-height: 30px;
  color: #1b1c1c;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.news-row__excerpt {
  font-family: Inter, sans-serif;
  font-size: 15px;
  line-height: 24px;
  color: #5f5e5e;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-row__more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: Inter, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #EA1D00;
}

.news-row:hover .news-row__more {
  color: #F5C518;
}

.page-hero-band {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: #eae8e7;
}

@media (min-width: 768px) {
  .page-hero-band {
    height: 280px;
  }
}

.breadcrumb-bar {
  background: #f5f3f3;
  border-bottom: 1px solid #E5E7EB;
}
