/*
 * Jasace ACE — hand-written site styles.
 * Utility classes (flex, px-6, text-stone-400, ...) live in tailwind.css, which is
 * generated; see tools/tailwind/README.md. Everything in this file is edited by hand.
 */

/* ── Fonts ───────────────────────────────────── */
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-weight: 300 700;
  font-stretch: 100%;
  font-display: swap;
  src: url("/assets/fonts/archivo-latin.woff2") format("woff2");
}

@font-face {
  font-family: "Syne";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("/assets/fonts/syne-latin.woff2") format("woff2");
}

:root {
  --font-display: "Syne", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --terra: #b8432f;
  --gold: #c9a96e;
}

/* ── Base ────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

[hidden] {
  display: none !important;
}

::selection {
  background-color: #b8432f;
  color: #faf9f6;
}

/* ── Focus Accessibility ─────────────────────── */
*:focus-visible {
  outline: 2px solid #b8432f;
  outline-offset: 2px;
}

/* Skip to content — visible only on keyboard focus */
.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  padding: 12px 24px;
  background: #1a1816;
  color: #faf9f6;
  font-size: 14px;
  font-weight: 600;
  transition: top 0.2s ease-out;
}

.skip-link:focus {
  top: 12px;
}

/* Image that fills its positioned parent (use with .object-cover / .object-contain) */
.img-fill {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: transparent;
}

/* ── Architectural Grid Background ────────────── */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(226, 223, 217, 0.4) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(226, 223, 217, 0.4) 1px, transparent 1px);
  background-size: 60px 60px;
}

.bg-grid-dark {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 60px 60px;
}

/* ── Grain Texture Overlay ───────────────────── */
.grain::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.03;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Scroll-triggered Animations (site.js adds .visible) ── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition:
    opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ── Keyframes used by inline `animation:` styles ── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  50% { opacity: 0.5; }
}

/* ── Marquee / Ticker ────────────────────────── */
@keyframes marquee {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.marquee-track {
  animation: marquee 30s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

/* ── Mobile menu (site.js toggles .is-open and sets the stagger delays) ── */
[data-site-nav].menu-open {
  z-index: 60;
}

[data-menu-item] {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

[data-mobile-menu].is-open [data-menu-item] {
  opacity: 1;
  transform: translateY(0);
}

/* ── Form spam trap: a field people never see; only bots fill it in ── */
.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ── Testimonials ────────────────────────────── */
/* All quotes share one grid cell, so the block is as tall as the longest one. */
[data-testimonials] {
  display: grid;
  align-items: center;
}

.testimonial-slide {
  grid-area: 1 / 1;
  transition: opacity 0.6s ease-out, visibility 0.6s;
}

.testimonial-slide.is-off {
  opacity: 0;
  visibility: hidden;
}

.testimonial-quote {
  font-size: clamp(1rem, 0.9rem + 0.45vw, 1.25rem);
  line-height: 1.65;
}

.testimonial-quote p + p {
  margin-top: 1em;
}

/* ── Horizontal Rule ─────────────────────────── */
.hr-accent {
  height: 1px;
  background: linear-gradient(to right, #b8432f, #c9a96e, transparent);
}

/* ── Utilities ───────────────────────────────── */
.text-balance {
  text-wrap: balance;
}

.glass {
  background: rgba(255, 255, 255, 0.03);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.text-gradient {
  background: linear-gradient(135deg, #b8432f 0%, #c9a96e 50%, #b8432f 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  padding-bottom: 0.15em;
  margin-bottom: -0.15em;
  display: inline-block;
}

/* ── Custom Scrollbar (dark) ─────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: #0f0e0d;
}

::-webkit-scrollbar-thumb {
  background: #3d3a35;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #5c5750;
}

/* ── Blog article body ───────────────────────── */
.blog-prose {
  color: #d4d0c8;
}

.blog-prose > * + * {
  margin-top: 1.5rem;
}

.blog-prose p {
  color: #d4d0c8;
  line-height: 1.9;
}

.blog-prose h2 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 2vw, 2.25rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: #faf9f6;
}

.blog-prose h3 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 1.6vw, 1.6rem);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #f0ede8;
}

.blog-prose ul,
.blog-prose ol {
  padding-left: 1.5rem;
  color: #d4d0c8;
}

.blog-prose ul { list-style: disc; }
.blog-prose ol { list-style: decimal; }

.blog-prose li + li {
  margin-top: 0.5rem;
}

.blog-prose blockquote {
  border-left: 3px solid rgba(184, 67, 47, 0.7);
  background: rgba(184, 67, 47, 0.08);
  padding: 1rem 1.25rem;
  color: #f0ede8;
  font-style: italic;
}

.blog-prose a {
  color: #d4654f;
  text-decoration: underline;
  text-decoration-color: rgba(212, 101, 79, 0.45);
  text-underline-offset: 0.2em;
}

.blog-prose a:hover {
  color: #f0b5a7;
  text-decoration-color: rgba(240, 181, 167, 0.8);
}

.blog-prose img {
  width: 100%;
  border-radius: 1.5rem;
  border: 1px solid #3d3a35;
}

/* ── Reduced motion ──────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { transition: none; }
  .marquee-track { animation: none; }
}

/* Service tabs: room for three rows of chips now that some labels are longer. */
[data-service-tab] .max-h-20 {
  max-height: 8rem;
}

/* Logo: "AS" sits smaller between the red J and the red ACE. */
.logo-as {
  font-size: 0.72em;
}

/* Home hero: the headline and the discipline line under it share one width so the line centres on the headline. */
@media (min-width: 1024px) {
  .hero-title {
    width: max-content;
  }
}

/* Home "We've Built With": nine equal columns on desktop. */
@media (min-width: 1024px) {
  .built-with-grid {
    grid-template-columns: repeat(9, auto);
  }

  .built-with-grid span {
    padding-inline: 0.375rem;
  }
}

/* Between 1024px and 1280px the nine labels only fit at a slightly smaller size. */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .built-with-grid span {
    font-size: 0.8125rem;
  }
}

/* Nine cells leave the last one alone on its row on smaller screens: centre it. */
@media (max-width: 1023.98px) {
  .built-with-last {
    grid-column: 1 / -1;
  }
}

/* Home service names: all capitals, with a larger red first letter (A / C / E). */
.ace-word {
  text-transform: uppercase;
}

.ace-initial {
  color: var(--terra);
  font-size: 1.6em;
  line-height: 1;
}

/* Header menu: six links only fit beside the logo and Connect button on tablet widths when set a little tighter. */
@media (min-width: 768px) and (max-width: 1023.98px) {
  .site-nav-links {
    gap: 1rem;
  }

  .site-nav-links a {
    font-size: 0.8125rem;
  }
}
