/* ===== Common page styles for top-level routes
   services.html / cases.html / about.html / contacts.html ===== */

/* ---- Page hero with background image / video ---- */
.page-hero {
  position: relative;
  padding: 180px var(--pad-x) 100px;
  background: #050505;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  min-height: 540px;
  display: flex;
  align-items: flex-end;
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}
.page-hero-img,
.page-hero-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: saturate(0.95) brightness(0.5) contrast(1.06);
  animation: pageHeroIn 1.6s var(--ease) both;
}
.page-hero-video {
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.page-hero-video.is-loaded { opacity: 1; }
@keyframes pageHeroIn {
  from { transform: scale(1.06); opacity: 0.5; }
  to   { transform: scale(1);    opacity: 1; }
}
.page-hero-grid {
  position: absolute;
  inset: 0;
  z-index: 1;
  mix-blend-mode: overlay;
  opacity: 0.55;
  pointer-events: none;
  background:
    linear-gradient(to right, rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 96px 100%,
    linear-gradient(to bottom, rgba(255,255,255,0.045) 1px, transparent 1px) 0 0 / 100% 96px;
}
.page-hero-vignette {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 70% 100% at 20% 100%, rgba(230,48,39,0.18), transparent 60%),
    linear-gradient(to bottom, rgba(0,0,0,0.55) 0%, transparent 30%, transparent 50%, rgba(0,0,0,0.92) 100%),
    linear-gradient(to right, rgba(0,0,0,0.6) 0%, transparent 45%);
}
.page-hero .trail {
  z-index: 3;
}
.page-hero-corner {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.42);
  z-index: 4;
  pointer-events: none;
}
.page-hero-corner-tl { top: 90px; left: var(--pad-x); }
.page-hero-corner-tr { top: 90px; right: var(--pad-x); }
.page-hero-corner-br {
  bottom: 28px; right: var(--pad-x);
  color: var(--accent);
}
.page-hero-corner-br::before {
  content: '●';
  margin-right: 8px;
  animation: pulse 1.6s infinite;
  font-size: 9px;
}
@media (max-width: 640px) {
  .page-hero-corner-tl, .page-hero-corner-tr { display: none; }
}
.page-hero-inner {
  position: relative;
  z-index: 5;
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: end;
  width: 100%;
}
.page-hero-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 720px;
}
.page-hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(44px, 6.4vw, 96px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin: 0;
  text-wrap: balance;
}
.page-hero h1 .accent { color: var(--accent); }
.page-hero-lead {
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.45;
  color: var(--text-dim);
  max-width: 600px;
  margin: 0;
}
.page-hero-meta {
  display: flex;
  gap: 36px;
  flex-wrap: wrap;
  padding-top: 28px;
  border-top: 1px solid var(--border);
  margin-top: 28px;
}
.page-hero-meta .item .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.page-hero-meta .item .value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: #fff;
  letter-spacing: -0.02em;
}
.page-hero-meta .item .value .accent { color: var(--accent); }

@media (max-width: 900px) {
  .page-hero { padding-top: 130px; padding-bottom: 56px; }
  .page-hero-inner { grid-template-columns: 1fr; gap: 32px; }
}

/* ---- Nav active state ---- */
.nav a.is-active {
  color: #fff;
}
.nav a.is-active::after {
  right: 0 !important;
}

/* ---- Services index page ---- */
.services-grid-full {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) { .services-grid-full { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .services-grid-full { grid-template-columns: 1fr; } }

/* compare table */
.compare-section {
  padding: var(--pad-section) 0;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.compare-table {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg);
}
.compare-row {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 0;
  border-bottom: 1px solid var(--border);
}
.compare-row:last-child { border-bottom: none; }
.compare-cell {
  padding: 18px 20px;
  font-size: 14px;
  color: var(--text-dim);
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
}
.compare-cell:last-child { border-right: none; }
.compare-row.is-head .compare-cell {
  background: var(--bg-1);
  color: var(--text-dim);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.compare-row .compare-cell:first-child {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 16px;
  color: #fff;
  letter-spacing: -0.015em;
}
.compare-cell .accent { color: var(--accent); }
@media (max-width: 900px) {
  .compare-table { overflow-x: auto; }
  .compare-row { grid-template-columns: 1.4fr repeat(4, minmax(140px, 1fr)); min-width: 760px; }
}

/* ---- Cases index page ---- */
.cases-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 32px 0 48px;
}
.cases-full-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
@media (max-width: 1024px) { .cases-full-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .cases-full-grid { grid-template-columns: 1fr; } }

/* Dark-theme cases section on cases.html
   (default .cases is light, but inside .cases-list we want dark) */
.cases-list {
  background: var(--bg);
  color: var(--text);
}
.cases-list .case {
  background: var(--bg-1);
  border: 1px solid var(--border);
  box-shadow: none;
}
.cases-list .case:hover {
  border-color: rgba(230,48,39,0.4);
  box-shadow: 0 24px 60px -20px rgba(0,0,0,0.8), 0 0 0 1px rgba(230,48,39,0.18);
}
.cases-list .case-media {
  border-bottom: 1px solid var(--border);
}
.cases-list .case-brand {
  color: var(--accent);
  font-weight: 600;
}
.cases-list .case-title {
  color: #fff;
}
.cases-list .case-num {
  color: #fff;
}
.cases-list .case-num-lbl {
  color: var(--text-dim);
}
.cases-list .case-metrics {
  border-top-color: var(--border);
  border-bottom-color: var(--border);
}
.cases-list .case-link {
  color: var(--accent);
}

/* ---- About page ---- */
.about-story {
  padding: var(--pad-section) 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.about-story-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: start;
}
.about-story-text p {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 18px;
}
.about-story-text p:last-child { margin-bottom: 0; }
.about-story-text strong { color: #fff; font-weight: 500; }
.about-story-aside {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 16px;
  overflow: hidden;
  background: #050505;
}
.about-story-aside img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: saturate(0.95) brightness(0.85);
}
.about-story-aside::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.7));
}
@media (max-width: 900px) {
  .about-story-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-story-aside { aspect-ratio: 16/10; }
}

/* values grid */
.values-section {
  padding: var(--pad-section) 0;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
}
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-top: 40px;
}
.value-card {
  background: var(--bg);
  padding: 40px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 220px;
  transition: background 0.25s var(--ease);
}
.value-card:hover { background: var(--bg-1); }
.value-card .num {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--accent);
}
.value-card h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0;
}
.value-card p {
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
}
@media (max-width: 900px) { .values-grid { grid-template-columns: 1fr; } }

/* team */
.team-section {
  padding: var(--pad-section) 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 40px;
}
.team-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.team-photo {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 14px;
  overflow: hidden;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,0.04) 0, rgba(255,255,255,0.04) 1px, transparent 1px, transparent 16px),
    radial-gradient(ellipse at 60% 30%, rgba(230,48,39,0.18), transparent 60%),
    linear-gradient(180deg, #15151a 0%, #050505 100%);
  display: flex;
  align-items: flex-end;
  padding: 18px;
}
.team-photo .label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.4);
}
.team-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 18px;
  color: #fff;
  letter-spacing: -0.015em;
}
.team-role {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
@media (max-width: 900px) { .team-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .team-grid { grid-template-columns: 1fr; } }

/* ---- Contacts page ---- */
.contacts-section {
  padding: var(--pad-section) 0;
  background: var(--bg);
}
.contacts-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 60px;
  align-items: start;
}
.contacts-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
}
.contact-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.contact-row:last-child { border-bottom: none; }
.contact-row .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
}
.contact-row .value {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 18px;
  color: #fff;
  letter-spacing: -0.015em;
}
.contact-row .value a:hover { color: var(--accent); }
.contact-row .value small {
  display: block;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--text-dim);
  font-weight: 400;
  letter-spacing: 0;
  margin-top: 4px;
}

.contact-form {
  background: var(--bg-1);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px;
}
.contact-form h2 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 32px;
  letter-spacing: -0.025em;
  margin: 0 0 8px;
  color: #fff;
}
.contact-form .subtitle {
  color: var(--text-dim);
  font-size: 14px;
  margin: 0 0 24px;
}
.contact-form .modal-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 900px) {
  .contacts-grid { grid-template-columns: 1fr; gap: 32px; }
  .contact-form { padding: 28px 20px; }
  .contact-form .modal-form { grid-template-columns: 1fr; }
}

/* big map block */
.map-block {
  padding: 0 var(--pad-x) var(--pad-section);
}
.map-frame {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16/7;
  background: linear-gradient(180deg, #050505 0%, #0a0a0a 100%);
}
.map-frame iframe {
  width: 100%; height: 100%; border: 0;
  filter: invert(0.92) hue-rotate(180deg) saturate(0.6);
}
.map-frame .map-placeholder {
  position: absolute; inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--text-dim);
  text-transform: uppercase;
}

/* Custom red pin over the map (tip of the pin at exact center of iframe) */
.map-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  /* shift up so the pointed tip sits at the center */
  transform: translate(-50%, calc(-100% + 8px));
  width: 36px;
  height: 48px;
  color: var(--accent);
  pointer-events: none;
  z-index: 5;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,0.6));
  animation: mapPinDrop 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes mapPinDrop {
  0%   { transform: translate(-50%, calc(-100% - 40px)); opacity: 0; }
  100% { transform: translate(-50%, calc(-100% + 8px));  opacity: 1; }
}
.map-pin-svg {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 2;
}
/* Pulsing red ring beneath the pin tip */
.map-pin-pulse {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--accent);
  transform: translate(-50%, 60%);
  z-index: 1;
  animation: mapPinPulse 2.2s ease-out infinite;
}
@keyframes mapPinPulse {
  0%   { transform: translate(-50%, 60%) scale(0.4); opacity: 0.65; }
  100% { transform: translate(-50%, 60%) scale(2.6); opacity: 0; }
}
/* Small label next to the pin */
.map-pin-label {
  position: absolute;
  left: calc(100% + 10px);
  top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(10,10,10,0.85);
  border: 1px solid rgba(230,48,39,0.55);
  border-radius: 6px;
  padding: 6px 10px;
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 2;
}
.map-pin-label::before {
  content: '';
  position: absolute;
  left: -5px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: rgba(10,10,10,0.85);
  border-left: 1px solid rgba(230,48,39,0.55);
  border-bottom: 1px solid rgba(230,48,39,0.55);
  transform: translateY(-50%) rotate(45deg);
}
@media (max-width: 640px) {
  .map-pin-label { display: none; }
  .map-pin { width: 28px; height: 38px; }
}
