﻿/* Full-background flight animation */
.flight-path {
  position: fixed;
  z-index: -1;
  inset: 0;
  width: 100vw;
  height: 100svh;
  pointer-events: none;
  opacity: .62;
}
.trail { position: absolute; inset: 0; width: 100%; height: 100%; }
.trail path {
  stroke: rgba(81,214,231,.38);
  stroke-width: 2.2;
  stroke-dasharray: 2 11;
  animation: dash 18s linear infinite;
}
.paper-plane {
  position: absolute;
  top: 0;
  left: 0;
  right: auto;
  width: clamp(46px, 5vw, 68px);
  animation: fly-screen 13s cubic-bezier(.45,.02,.55,.98) infinite;
  filter: drop-shadow(0 14px 9px rgba(0,0,0,.28));
}
.paper-plane::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: clamp(80px, 12vw, 155px);
  height: 34px;
  right: 72%;
  top: 52%;
  border-top: 3px dotted rgba(81,214,231,.72);
  border-radius: 58% 0 0 0;
  transform: rotate(-8deg);
  transform-origin: right center;
}
.paper-plane svg { overflow: visible; transform: none; }
.paper-plane .plane-paper { fill: #fff; stroke: #51d6e7; stroke-width: 1.8; stroke-linejoin: round; }
.paper-plane .plane-fold { fill: none; stroke: #215cff; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.trail { opacity: 0; }

@keyframes fly-screen {
  0%   { transform: translate(-12vw, 24vh) rotate(10deg); opacity: 0; }
  5%   { opacity: 1; }
  22%  { transform: translate(16vw, 7vh) rotate(-13deg); }
  43%  { transform: translate(38vw, 31vh) rotate(14deg); }
  63%  { transform: translate(61vw, 12vh) rotate(-12deg); }
  81%  { transform: translate(78vw, 34vh) rotate(18deg); }
  95%  { opacity: 1; }
  100% { transform: translate(110vw, 24vh) rotate(-5deg); opacity: 0; }
}

/* True single viewport on phones and tablets */
@media (max-width: 900px) {
  html, body { height: 100%; overflow: hidden; }
  body { min-height: 100svh; display: grid; grid-template-rows: 64px minmax(0, 1fr); }
  .site-header { height: 64px; }
  main {
    width: calc(100% - 28px);
    height: calc(100svh - 64px);
    min-height: 0;
    display: grid;
    grid-template-rows: minmax(178px, .78fr) minmax(286px, 1.22fr);
    gap: 0;
    overflow: hidden;
  }
  .hero { min-height: 0; padding: 18px 0 12px; align-self: center; }
  .hero::before { display: none; }
  .eyebrow { margin-bottom: 9px; font-size: 9px; }
  h1 { max-width: 620px; font-size: clamp(2.35rem, 9.5vw, 4rem); line-height: .94; }
  .hero-copy { max-width: 600px; margin: 12px 0 0; font-size: 12px; line-height: 1.42; }
  .solutions { min-height: 0; padding: 0 0 10px; display: grid; grid-template-rows: auto minmax(0, 1fr); }
  .section-heading { margin-bottom: 10px; }
  .section-heading h2 { margin-top: 6px; font-size: 1.35rem; }
  .kicker { font-size: 9px; }
  .card-grid { min-height: 0; height: 100%; grid-template-columns: repeat(2, 1fr); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .solution-card { min-height: 0; height: 100%; padding: 13px; grid-template-columns: 28px 1fr; grid-template-rows: auto 1fr auto; gap: 4px 8px; }
  .card-icon { width: 28px; height: 28px; }
  .card-icon svg { width: 18px; }
  .card-body { align-content: center; }
  .card-body strong { font-size: clamp(11px, 3.3vw, 14px); line-height: 1.12; }
  .card-link { padding-top: 5px; font-size: 8px; }
  .card-link b { font-size: 13px; }
  footer { display: none; }
  .flight-path { opacity: .42; }
  .paper-plane { width: 34px; }
  .paper-plane::before { width: 76px; border-top-width: 2px; }
}

@media (max-width: 430px) and (max-height: 720px) {
  body { grid-template-rows: 56px minmax(0, 1fr); }
  .site-header { height: 56px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: 17px; }
  main { height: calc(100svh - 56px); grid-template-rows: minmax(150px, .68fr) minmax(270px, 1.32fr); }
  .hero { padding: 9px 0 7px; }
  h1 { font-size: clamp(2.05rem, 11vw, 2.8rem); }
  .hero-copy { font-size: 10px; line-height: 1.3; }
  .solution-card { padding: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .paper-plane { transform: translate(76vw, 9vh) rotate(-8deg); opacity: .72; }
}

/* User-provided animated paper-plane artwork */
body { background: #3257b2; }
.ambient { display: none; }
.flight-path {
  opacity: 1;
  background-color: #3257b2;
  background-image: url("paper-plane.gif");
  background-repeat: no-repeat;
  background-position: right center;
  background-size: contain;
}
.flight-path > * { display: none; }
.hero::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -18px -30px;
  border-radius: 30px;
  background: linear-gradient(90deg, rgba(7,20,47,.42), rgba(7,20,47,.16) 72%, transparent);
  backdrop-filter: blur(1.5px);
}
.solution-card { background: rgba(7,20,47,.58); border-color: rgba(255,255,255,.22); }
.card-featured { background: linear-gradient(145deg, rgba(7,20,47,.74), rgba(33,92,255,.48)); }
footer { background: rgba(7,20,47,.22); }

@media (max-width: 900px) {
  .flight-path { background-position: center center; background-size: contain; }
  .hero::after { inset: -8px -14px; border-radius: 20px; background: linear-gradient(90deg, rgba(7,20,47,.5), rgba(7,20,47,.18)); }
  .solution-card { background: rgba(7,20,47,.68); backdrop-filter: blur(7px); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; max-width: 100%; }
  .solution-card { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; }
  .card-body { min-width: 0; max-width: 100%; overflow: hidden; }
  .card-body strong { overflow-wrap: anywhere; hyphens: auto; }
  .card-link { min-width: 0; overflow: hidden; }
}

@media (max-width: 360px) {
  main { width: calc(100% - 18px); }
  .card-grid { gap: 6px; }
  .solution-card { padding: 8px; grid-template-columns: 24px minmax(0, 1fr); gap: 3px 6px; }
  .card-icon { width: 24px; height: 24px; }
  .card-icon svg { width: 15px; }
  .card-body strong { font-size: 10px; }
  .card-link { font-size: 7px; }
}

/* Mobile-first catalog: heading and cards share one viewport */
main {
  display: block;
  height: calc(100svh - 144px);
  min-height: 0;
}
.solutions {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(18px, 3vh, 34px) 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}
.section-heading { align-items: center; margin-bottom: clamp(14px, 2vh, 24px); }
.section-heading h1 { margin: 7px 0 0; font-size: clamp(2rem, 4vw, 4rem); line-height: 1; }
.section-heading p strong { color: white; }
.card-grid {
  min-height: 0;
  height: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
}
.solution-card { min-width: 0; min-height: 0; height: 100%; overflow: hidden; }
.card-body { min-width: 0; }

@media (max-width: 900px) {
  main { width: calc(100% - 22px); height: calc(100svh - 64px); display: block; }
  .solutions { padding: 10px 0 8px; grid-template-rows: auto minmax(0, 1fr); }
  .section-heading { display: block; margin-bottom: 9px; }
  .section-heading h1 { margin-top: 4px; font-size: clamp(1.75rem, 8vw, 2.7rem); line-height: .96; }
  .section-heading p { display: block; max-width: 100%; margin: 7px 0 0; font-size: 10px; line-height: 1.28; color: #d5def0; }
  .card-grid { width: 100%; height: 100%; gap: 7px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
  .solution-card { width: 100%; max-width: 100%; min-width: 0; min-height: 0; height: 100%; padding: 10px; grid-template-columns: 26px minmax(0, 1fr); grid-template-rows: auto 1fr auto; gap: 3px 7px; }
  .card-icon { width: 26px; height: 26px; }
  .card-icon svg { width: 16px; }
  .card-body { min-width: 0; overflow: hidden; }
  .card-body strong { font-size: clamp(10px, 3.25vw, 13px); line-height: 1.1; overflow-wrap: anywhere; }
  .card-link { min-width: 0; padding-top: 4px; font-size: 7px; }
}

@media (max-width: 430px) and (max-height: 700px) {
  main { height: calc(100svh - 56px); }
  .solutions { padding-top: 5px; }
  .section-heading { margin-bottom: 5px; }
  .section-heading h1 { font-size: 1.55rem; }
  .section-heading p { font-size: 9px; line-height: 1.18; }
  .solution-card { padding: 7px; }
  .card-number { font-size: 8px; }
}

/* Compact service cards */
.solutions { align-content: start; }
.card-grid {
  height: auto;
  align-self: start;
  align-content: start;
  grid-template-rows: none;
}
.solution-card {
  height: auto;
  min-height: 132px;
  padding: 14px;
}
.card-icon { width: 36px; height: 36px; }
.card-body { gap: 5px; }
.card-link { padding-top: 8px; }

@media (max-width: 900px) {
  .card-grid { height: auto; grid-template-rows: none; gap: 7px; }
  .solution-card {
    height: auto;
    min-height: 104px;
    padding: 7px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 2px 6px;
  }
  .card-icon { width: 24px; height: 24px; border-radius: 8px; }
  .card-icon svg { width: 15px; }
  .card-link { padding-top: 3px; }
}

@media (max-width: 360px) {
  .solution-card { min-height: 94px; padding: 6px; }
}
