html {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
}

img {
  max-width: 100%;
}

.hero-ink-field,
.ink-headline-wrap {
  pointer-events: none;
}

.hero-ink-field {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.hero-ink-field span {
  position: absolute;
  width: var(--size);
  height: var(--size);
  left: var(--x);
  top: var(--y);
  border-radius: 44% 56% 62% 38% / 44% 42% 58% 56%;
  background:
    radial-gradient(circle at 32% 30%, rgba(255,255,255,0.34), transparent 0 10%, transparent 11%),
    radial-gradient(circle at 70% 72%, rgba(255,255,255,0.24), transparent 0 8%, transparent 9%),
    var(--ink);
  box-shadow:
    18px -10px 0 -10px var(--ink),
    -16px 14px 0 -11px var(--ink),
    24px 22px 0 -14px var(--ink),
    -24px -20px 0 -16px var(--ink);
  opacity: 0;
  filter: blur(0.2px);
  transform: translate3d(var(--from-x), var(--from-y), 0) rotate(var(--rot)) scale(0.18);
  animation: inkThrow 1.35s cubic-bezier(0.16, 1, 0.3, 1) var(--delay) both;
}

.ink-headline-wrap {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

.ink-title {
  position: relative;
  z-index: 2;
  isolation: isolate;
}

.ink-word {
  position: relative;
  display: inline-block;
  color: #f47920 !important;
}

.ink-word::before,
.ink-word::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  background: rgba(244, 121, 32, 0.18);
  transform-origin: left center;
  animation: inkSwipe 1.05s cubic-bezier(0.16, 1, 0.3, 1) 0.78s both;
}

.ink-word::before {
  left: -0.08em;
  right: -0.1em;
  bottom: 0.03em;
  height: 0.22em;
}

.ink-word::after {
  width: 0.18em;
  height: 0.18em;
  right: -0.32em;
  top: 0.12em;
  box-shadow:
    0.38em 0.16em 0 -0.03em rgba(244, 121, 32, 0.45),
    0.18em 0.52em 0 -0.05em rgba(14, 26, 69, 0.35),
    -0.12em -0.28em 0 -0.06em rgba(244, 121, 32, 0.42);
}

.ink-splash {
  position: absolute;
  z-index: 1;
  width: var(--size);
  height: var(--size);
  left: var(--x);
  top: var(--y);
  border-radius: 47% 53% 42% 58% / 54% 38% 62% 46%;
  background:
    radial-gradient(circle at 38% 36%, rgba(255,255,255,0.38), transparent 0 8%, transparent 9%),
    var(--ink);
  box-shadow:
    14px -11px 0 -9px var(--ink),
    -18px 8px 0 -11px var(--ink),
    22px 18px 0 -14px var(--ink),
    -10px -18px 0 -13px var(--ink);
  opacity: 0;
  transform: translate3d(var(--from-x), var(--from-y), 0) rotate(var(--rot)) scale(0.12);
  animation: inkThrow 1.2s cubic-bezier(0.16, 1, 0.3, 1) var(--delay) both;
}

.ink-drip {
  position: absolute;
  z-index: 1;
  width: 5px;
  height: 42px;
  left: var(--x);
  top: var(--y);
  border-radius: 999px;
  background: linear-gradient(to bottom, var(--ink), rgba(244, 121, 32, 0));
  opacity: 0;
  transform: scaleY(0);
  transform-origin: top;
  animation: inkDrip 1.45s ease var(--delay) both;
}

@keyframes inkThrow {
  0% {
    opacity: 0;
    transform: translate3d(var(--from-x), var(--from-y), 0) rotate(var(--rot)) scale(0.12);
  }
  58% {
    opacity: 0.92;
    transform: translate3d(0, 0, 0) rotate(calc(var(--rot) * -0.25)) scale(1.08);
  }
  100% {
    opacity: var(--alpha, 0.55);
    transform: translate3d(0, 0, 0) rotate(0deg) scale(1);
  }
}

@keyframes inkSwipe {
  from {
    opacity: 0;
    transform: scaleX(0) rotate(-1.5deg);
  }
  to {
    opacity: 1;
    transform: scaleX(1) rotate(-1.5deg);
  }
}

@keyframes inkDrip {
  0% {
    opacity: 0;
    transform: translateY(-8px) scaleY(0);
  }
  35% {
    opacity: 0.55;
  }
  100% {
    opacity: 0.34;
    transform: translateY(14px) scaleY(1);
  }
}

.btn-orange {
  background: #f47920;
  color: white;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.05em;
  padding: 10px 22px;
  border-radius: 6px;
  display: inline-block;
  transition: background 0.2s, transform 0.15s;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.btn-orange:hover { background: #d9620f; transform: translateY(-2px); }
.btn-orange:active { transform: translateY(0); }

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(244, 121, 32, 0.45);
  outline-offset: 3px;
}

@media (max-width: 900px) {
  body > div[style*="background:#0e1a45"],
  body > div[style*="background:#1e2d6b"] {
    display: none !important;
  }

  .ink-headline-wrap {
    overflow: hidden !important;
  }

  nav {
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    background: #fff !important;
    box-shadow: 0 1px 10px rgba(0,0,0,0.08) !important;
  }

  /* Row 1: Logo left | CONTACT US right. Row 2: Nav links centered */
  nav > div {
    position: relative !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    gap: 0 !important;
    padding: 8px 16px !important;
    max-width: none !important;
  }

  nav > div > a:first-child {
    display: block !important;
    line-height: 0 !important;
    width: auto !important;
    flex-shrink: 0 !important;
  }

  nav img[alt="Printing R Us"] {
    height: 52px !important;
    width: auto !important;
    display: block !important;
  }

  /* Nav links: full-width second row, centered */
  nav ul {
    flex: 0 0 100% !important;
    width: 100% !important;
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 6px 10px !important;
    margin: 0 !important;
    padding: 6px 0 4px !important;
  }

  /* CONTACT US: absolute top-right, logo row only */
  nav ul li:last-child {
    position: absolute !important;
    right: 16px !important;
    top: 8px !important;
    height: 52px !important;
    bottom: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: auto !important;
    order: unset !important;
    margin: 0 !important;
  }

  nav ul li:last-child a {
    padding: 8px 20px !important;
    border-radius: 999px !important;
    font-size: 14px !important;
    letter-spacing: 0.07em !important;
    min-height: unset !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
  }

  nav .nav-link {
    color: #2d4591 !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    letter-spacing: 0.06em !important;
    white-space: nowrap !important;
  }

  nav .nav-link.active {
    color: #f47920 !important;
  }

  [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  [style*="display:flex;justify-content:space-around"] > [style*="width:1px"] {
    display: none !important;
  }

  .local-faq-layout {
    grid-template-columns: 1fr !important;
  }

  .faq-contact-panel {
    position: static !important;
  }
}

@media (max-width: 640px) {
  .service-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  .local-faq-section {
    padding: 64px 18px !important;
  }

  .local-faq-section h2 {
    font-size: 32px !important;
    line-height: 1.18 !important;
  }

  .faq-card p {
    font-size: 16.5px !important;
    line-height: 1.72 !important;
  }

  .local-faq-grid {
    grid-template-columns: 1fr !important;
  }

  .faq-card,
  .faq-contact-panel {
    padding: 22px !important;
  }

  .ink-headline-wrap {
    overflow: hidden !important;
  }

  body > div:first-of-type > div {
    flex-direction: column !important;
    gap: 8px !important;
    text-align: center !important;
  }

  body > div:first-of-type > div > div:first-child {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 10px 16px !important;
  }

  nav img[alt="Printing R Us"] {
    height: 48px !important;
  }

  nav ul {
    gap: 10px 8px !important;
  }

  .nav-link {
    font-size: 13px !important;
    white-space: nowrap !important;
  }

  section {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  /* Hero sections: allow auto height so content never gets clipped */
  section[style*="overflow:hidden"][style*="display:flex"][style*="align-items:center"] {
    height: auto !important;
    min-height: 460px !important;
  }

  /* Add vertical padding to hero content on mobile */
  section[style*="overflow:hidden"][style*="display:flex"][style*="align-items:center"] > div[style*="z-index:2"] {
    padding-top: 52px !important;
    padding-bottom: 52px !important;
  }

  [style*="grid-template-columns:repeat(4,1fr)"],
  [style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  [style*="grid-template-columns:repeat(3,1fr)"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  [style*="max-width:1200px"][style*="display:flex"] {
    flex-direction: column !important;
  }

  /* Nav div must stay row on mobile: higher specificity (0,2,2) beats (0,2,0) above */
  nav > div[style*="max-width:1200px"][style*="display:flex"] {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
  }

  [style*="min-width:280px"],
  [style*="min-width:260px"],
  [style*="min-width:240px"] {
    min-width: 0 !important;
    width: 100% !important;
  }

  h1 {
    font-size: clamp(30px, 8vw, 40px) !important;
  }

  h2 {
    font-size: clamp(22px, 6vw, 30px) !important;
  }

  /* Reduce all text ~20% on mobile */
  .nav-link { font-size: 14px !important; }
  .form-label { font-size: 13px !important; }
  .btn-submit { font-size: 15px !important; }
  [style*="font-size:73px"] { font-size: 58px !important; }
  [style*="font-size:65px"] { font-size: 52px !important; }
  [style*="font-size:60px"] { font-size: 48px !important; }
  [style*="font-size:58px"] { font-size: 46px !important; }
  [style*="font-size:50px"] { font-size: 40px !important; }
  [style*="font-size:48px"] { font-size: 38px !important; }
  [style*="font-size:45px"] { font-size: 36px !important; }
  [style*="font-size:43px"] { font-size: 34px !important; }
  [style*="font-size:38px"] { font-size: 30px !important; }
  [style*="font-size:33px"] { font-size: 26px !important; }
  [style*="font-size:30px"] { font-size: 24px !important; }
  [style*="font-size:28px"] { font-size: 22px !important; }
  [style*="font-size:25px"] { font-size: 20px !important; }
  [style*="font-size:21px"] { font-size: 17px !important; }
  [style*="font-size:20px"] { font-size: 16px !important; }
  [style*="font-size:19px"] { font-size: 15px !important; }
  [style*="font-size:18px"] { font-size: 14px !important; }
  [style*="font-size:16px"] { font-size: 13px !important; }

  .btn-orange,
  .btn-navy,
  .btn-submit {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  footer > div > div:first-child {
    gap: 24px !important;
  }

  .service-grid.service-grid {
    grid-template-columns: 1fr !important;
  }

}

@media (max-width: 640px) {
  .hero-ink-field span {
    opacity: 0.28;
  }

  .ink-splash {
    transform: scale(0.75);
  }

  .ink-drip {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-ink-field span,
  .ink-splash,
  .ink-drip,
  .ink-word::before,
  .ink-word::after,
  .service-card::before,
  .service-card-img::before,
  .service-card-img::after,
  .service-card span svg {
    animation: none !important;
    transform: none !important;
  }

  .hero-ink-field span,
  .ink-splash,
  .ink-drip,
  .ink-word::before,
  .ink-word::after {
    opacity: 0.28;
  }
}
