html { scroll-behavior: smooth; scroll-padding-top: 160px; }
@media (min-width: 768px) { html { scroll-padding-top: 200px; } }
#top, #about, #services, #work, #contact { scroll-margin-top: 160px; }
@media (min-width: 768px) { #top, #about, #services, #work, #contact { scroll-margin-top: 200px; } }
body { background: #070707; }

::selection { background: #c81e1e; color: #fff; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #070707; }
::-webkit-scrollbar-thumb { background: #c81e1e; }
::-webkit-scrollbar-thumb:hover { background: #8a0f12; }

.font-display { letter-spacing: -0.01em; }
.display-xl { font-family: 'Oswald', Impact, sans-serif; font-weight: 700; letter-spacing: -0.02em; line-height: 0.92; text-transform: uppercase; }

/* Diagonal red slash motif */
.slash-bg {
  background-image: repeating-linear-gradient(
    135deg,
    rgba(200, 30, 30, 0.08) 0px,
    rgba(200, 30, 30, 0.08) 2px,
    transparent 2px,
    transparent 14px
  );
}

/* Hero overlay */
.hero-grad {
  background:
    linear-gradient(180deg, rgba(7,7,7,0.55) 0%, rgba(7,7,7,0.75) 55%, rgba(7,7,7,0.98) 100%),
    linear-gradient(90deg, rgba(7,7,7,0.85) 0%, rgba(7,7,7,0.2) 60%, rgba(7,7,7,0.6) 100%);
}

/* Red diagonal bar */
.red-bar::before {
  content: '';
  display: inline-block;
  width: 44px;
  height: 4px;
  background: #c81e1e;
  margin-right: 14px;
  vertical-align: middle;
  transform: translateY(-4px);
}

/* ===== Gallery tile: cinematic hover ===== */
.tile { position: relative; overflow: hidden; background: #0b0b0b; display: block; cursor: pointer; isolation: isolate; width: 100%; padding: 0; border: 0; color: inherit; font: inherit; text-align: left; }
.tile:focus-visible { outline: 2px solid #e11d22; outline-offset: 3px; }
.tile img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.1s cubic-bezier(.2,.7,.2,1), filter .6s ease;
  filter: saturate(0.9) contrast(1.03);
}
.tile:hover img, .tile:focus-visible img { transform: scale(1.1); filter: saturate(0.4) contrast(1.1) brightness(0.55); }

/* Layer 1: dark gradient overlay */
.tile .t-dark {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(180deg, rgba(7,7,7,0.0) 0%, rgba(7,7,7,0.35) 55%, rgba(7,7,7,0.95) 100%),
              radial-gradient(circle at 30% 30%, rgba(200,30,30,0.0), rgba(200,30,30,0.0));
  opacity: 0; transition: opacity .5s ease;
}
.tile:hover .t-dark { opacity: 1; }

/* Layer 2: red diagonal slash that wipes in */
.tile .t-slash {
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(135deg, transparent 45%, rgba(200,30,30,0.85) 50%, transparent 55%);
  background-size: 220% 220%;
  background-position: 100% 100%;
  opacity: 0;
  transition: background-position .7s cubic-bezier(.2,.7,.2,1), opacity .35s ease;
  mix-blend-mode: screen;
}
.tile:hover .t-slash { opacity: 0.9; background-position: 0% 0%; }

/* Layer 3: corner brackets (top-left and bottom-right) */
.tile .t-corner { position: absolute; width: 22px; height: 22px; border: 2px solid #e11d22; z-index: 3; pointer-events: none; opacity: 0; transition: opacity .35s ease .1s, transform .45s cubic-bezier(.2,.7,.2,1) .1s; }
.tile .t-corner.tl { top: 14px; left: 14px; border-right: 0; border-bottom: 0; transform: translate(-6px,-6px); }
.tile .t-corner.br { bottom: 14px; right: 14px; border-left: 0; border-top: 0; transform: translate(6px,6px); }
.tile:hover .t-corner { opacity: 1; transform: translate(0,0); }

/* Layer 4: plus hotspot (top-right) */
.tile .t-plus {
  position: absolute; top: 16px; right: 16px; z-index: 4;
  width: 40px; height: 40px; border: 1.5px solid rgba(255,255,255,0.9);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-family: 'Oswald', sans-serif; font-weight: 300; font-size: 28px; line-height: 1;
  opacity: 0; transform: rotate(-90deg) scale(.6); transition: all .5s cubic-bezier(.2,.7,.2,1) .15s;
  background: rgba(200,30,30,0.85);
  pointer-events: none;
}
.tile:hover .t-plus { opacity: 1; transform: rotate(0) scale(1); }

/* Layer 5: tag label (slides up from bottom) */
.tile .tag {
  position: absolute; left: 18px; right: 18px; bottom: 18px; z-index: 5;
  color: #fff; font-family: 'Oswald', sans-serif; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 11px;
  opacity: 0; transform: translateY(14px);
  transition: opacity .5s ease .2s, transform .6s cubic-bezier(.2,.7,.2,1) .2s;
  pointer-events: none;
}
.tile .tag .line { display: block; width: 0; height: 2px; background: #e11d22; margin-bottom: 10px; transition: width .55s cubic-bezier(.2,.7,.2,1) .3s; }
.tile .tag .big { display: block; font-size: 20px; letter-spacing: -0.01em; font-weight: 700; text-transform: none; color: #fff; margin-top: 4px; font-family: 'Oswald', sans-serif; }
.tile:hover .tag { opacity: 1; transform: translateY(0); }
.tile:hover .tag .line { width: 44px; }

/* Service card */
.svc { position: relative; transition: transform .35s, border-color .35s, background-color .35s; }
.svc:hover { transform: translateY(-4px); border-color: #c81e1e; background-color: #171717; }
.svc::before {
  content: ''; position: absolute; left: 0; top: 0; width: 4px; height: 0;
  background: #c81e1e; transition: height .4s;
}
.svc:hover::before { height: 100%; }

/* Stat number */
.stat-num { font-family: 'Oswald', Impact, sans-serif; font-weight: 700; line-height: 1; letter-spacing: -0.02em; }

/* Hero ticker marquee */
@keyframes ticker { 0% { transform: translateX(0);} 100% { transform: translateX(-50%);} }
.ticker-track { display: flex; width: max-content; animation: ticker 45s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }

/* Corner brackets */
.bracket { position: relative; }
.bracket::before, .bracket::after {
  content: ''; position: absolute; width: 18px; height: 18px;
  border-color: #c81e1e; border-style: solid;
}
.bracket::before { top: -2px; left: -2px; border-width: 2px 0 0 2px; }
.bracket::after { bottom: -2px; right: -2px; border-width: 0 2px 2px 0; }

/* Mobile menu overlay */
.mmenu { position: fixed; inset: 0; z-index: 70; background: #000; transition: opacity .3s ease, transform .35s cubic-bezier(.2,.7,.2,1); }
.mmenu.is-closed { opacity: 0; transform: translateX(100%); pointer-events: none; }
.mmenu.is-open   { opacity: 1; transform: translateX(0);    pointer-events: auto; }
body.menu-open { overflow: hidden; }

/* ===== Lightbox ===== */
.lb { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.96); display: flex; align-items: center; justify-content: center; padding: 80px 20px 100px; transition: opacity .3s ease; }
.lb.is-closed { opacity: 0; pointer-events: none; }
.lb.is-open { opacity: 1; pointer-events: auto; }
.lb-img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 80px rgba(0,0,0,0.6); border: 1px solid rgba(255,255,255,0.06); }
.lb-btn { position: absolute; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 52px; height: 52px; border: 1px solid rgba(255,255,255,0.2); background: rgba(0,0,0,0.6); color: #fff; transition: background .2s, border-color .2s; backdrop-filter: blur(6px); }
.lb-btn:hover { background: #c81e1e; border-color: #c81e1e; }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: 20px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 20px; top: 50%; transform: translateY(-50%); }
.lb-caption { position: absolute; left: 0; right: 0; bottom: 24px; text-align: center; color: #fff; font-family: 'Oswald', sans-serif; font-weight: 500; letter-spacing: 0.12em; font-size: 13px; padding: 0 20px; }
.lb-counter { position: absolute; top: 24px; left: 24px; color: rgba(255,255,255,0.6); font-family: 'Oswald', sans-serif; letter-spacing: 0.3em; font-size: 12px; }
@media (max-width: 640px) {
  .lb-btn { width: 44px; height: 44px; }
  .lb-prev { left: 10px; } .lb-next { right: 10px; } .lb-close { top: 14px; right: 14px; }
}

/* ===== Preloader ===== */
.preloader { position: fixed; inset: 0; z-index: 9999; background: #000; display: flex; align-items: center; justify-content: center; transition: opacity .9s ease, visibility .9s ease; }
.preloader.is-hidden { opacity: 0; visibility: hidden; }
.preloader-inner { display: flex; flex-direction: column; align-items: center; gap: 40px; }

.preloader-logo-wrap { position: relative; width: 280px; height: 280px; display: flex; align-items: center; justify-content: center; }
@media (min-width: 768px) { .preloader-logo-wrap { width: 380px; height: 380px; } }

.preloader-logo {
  position: relative; z-index: 2; width: 72%; height: auto;
  animation: pl-float 3.4s ease-in-out infinite;
  filter: drop-shadow(0 0 50px rgba(200,30,30,0.35));
}

/* Rotating red arc ring around the logo */
.preloader-ring {
  position: absolute; inset: 0; border-radius: 50%;
  background: conic-gradient(from 0deg, transparent 0deg, transparent 260deg, #c81e1e 330deg, rgba(200,30,30,0) 360deg);
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
          mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  animation: pl-spin 2.8s linear infinite;
  opacity: 0.9;
}
/* Second counter-rotating thin ring */
.preloader-ring.r2 {
  inset: 14px;
  background: conic-gradient(from 180deg, transparent 0deg, transparent 300deg, rgba(255,255,255,0.35) 340deg, rgba(255,255,255,0) 360deg);
  animation: pl-spin-rev 3.6s linear infinite;
  opacity: 0.5;
}

/* Faint red glow pulse behind logo */
.preloader-glow {
  position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle, rgba(200,30,30,0.35) 0%, rgba(200,30,30,0) 70%);
  animation: pl-glow 2.4s ease-in-out infinite;
}

.preloader-bar { width: 240px; height: 2px; background: rgba(255,255,255,0.08); position: relative; overflow: hidden; }
.preloader-bar-fill { position: absolute; top: 0; left: 0; height: 100%; width: 0%; background: linear-gradient(90deg, #c81e1e, #e11d22); animation: pl-fill 1.8s ease-out forwards; box-shadow: 0 0 20px rgba(200,30,30,0.6); }

.preloader-text { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 12px; letter-spacing: 0.55em; text-transform: uppercase; color: rgba(255,255,255,0.55); display: inline-flex; align-items: baseline; gap: 2px; }
.preloader-text .dots { display: inline-flex; gap: 2px; margin-left: 2px; }
.preloader-text .dots span { opacity: 0; animation: pl-dot 1.4s infinite; }
.preloader-text .dots span:nth-child(1) { animation-delay: 0s; }
.preloader-text .dots span:nth-child(2) { animation-delay: 0.2s; }
.preloader-text .dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes pl-float { 0%, 100% { transform: translateY(0) scale(1); } 50% { transform: translateY(-8px) scale(1.03); } }
@keyframes pl-spin { to { transform: rotate(360deg); } }
@keyframes pl-spin-rev { to { transform: rotate(-360deg); } }
@keyframes pl-glow { 0%, 100% { opacity: 0.5; transform: scale(0.9); } 50% { opacity: 1; transform: scale(1.1); } }
@keyframes pl-fill { 0% { width: 0%; } 70% { width: 85%; } 100% { width: 100%; } }
@keyframes pl-dot { 0%, 40%, 100% { opacity: 0; } 50% { opacity: 1; } }

body.is-loading { overflow: hidden; }

/* ===== Back to top ===== */
.backtop {
  position: fixed; right: 16px; bottom: 16px; z-index: 80;
  width: 48px; height: 48px; background: #c81e1e; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transform: translateY(20px); pointer-events: none;
  transition: opacity .3s ease, transform .35s cubic-bezier(.2,.7,.2,1), background .2s;
  border: 0; cursor: pointer; padding: 0;
  box-shadow: 0 10px 30px rgba(200,30,30,0.4), 0 0 0 1px rgba(255,255,255,0.08);
}
.backtop::before { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,0.08); opacity: 0; transition: opacity .2s; }
.backtop:hover { background: #e11d22; transform: translateY(-4px); }
.backtop:hover::before { opacity: 1; }
.backtop.is-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.backtop:hover.is-visible { transform: translateY(-4px); }
.backtop:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
@media (min-width: 768px) { .backtop { right: 24px; bottom: 24px; width: 54px; height: 54px; } }

/* Reveal */
[data-reveal] { opacity: 0; transform: translateY(18px); transition: opacity .8s cubic-bezier(.2,.7,.2,1), transform .8s cubic-bezier(.2,.7,.2,1); }
[data-reveal].in { opacity: 1; transform: none; }

/* Link underline */
.nav-link { position: relative; }
.nav-link::after {
  content: ''; position: absolute; left: 0; bottom: -6px; width: 0; height: 2px;
  background: #c81e1e; transition: width .3s;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* Diagonal banner */
.skew-band { transform: skewY(-2deg); }
.skew-band > * { transform: skewY(2deg); }
