/* ==========================================================================
   Elvoros — pages.css
   Page-specific layouts: hero, home, services, about, contact.
   ========================================================================== */

/* ---------- Hero (home) ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  margin-top: calc(-1 * var(--nav-h));
  padding-top: var(--nav-h);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(720px 420px at 18% 22%, rgba(67, 52, 201, 0.14), transparent 70%),
    radial-gradient(700px 440px at 88% 82%, rgba(46, 27, 156, 0.12), transparent 70%),
    radial-gradient(900px 520px at 50% 38%, transparent 55%, rgba(0, 0, 0, 0.52) 100%);
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, transparent 0 39px, var(--grid-line) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, var(--grid-line) 39px 40px);
  -webkit-mask-image: radial-gradient(ellipse 85% 55% at 50% 100%, black 55%, transparent 78%);
  mask-image: radial-gradient(ellipse 85% 55% at 50% 100%, black 55%, transparent 78%);
}

.hero-hairline {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(157, 140, 255, 0.5), transparent);
  opacity: 0.9;
  pointer-events: none;
}

.hero-stage {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-brand-wrap {
  position: relative;
  width: 100%;
  max-width: 820px;
  height: clamp(120px, 18vw, 190px);
  margin-inline: auto;
  margin-bottom: 1.5rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: pan-y;
  filter: drop-shadow(0 6px 30px rgba(0, 0, 0, 0.55));
  transition: filter 220ms var(--ease);
  z-index: 2;
}

.hero-fallback-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(3rem, 11vw, 5.6rem);
  letter-spacing: 0.05em;
  color: #ffffff;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.6);
  user-select: none;
}

.hero.is-interacting #hero-canvas {
  filter: drop-shadow(0 6px 36px rgba(0, 0, 0, 0.6)) brightness(1.06);
}

.hero-content {
  position: relative;
  padding-block: 1rem 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 58rem;
}

.hero-content h1 {
  max-width: 18ch;
  margin-top: 0.6rem;
  /* Local override: keep the 3-line headline compact so the whole hero
     (wordmark → CTA) fits inside one 100svh screen without clipping. */
  font-size: clamp(2.1rem, 5vw, 3.9rem);
}

.hero-sub {
  max-width: 52ch;
  margin-top: 0.75rem;
  color: var(--ink-dim);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 1.25rem;
}

@media (max-width: 640px) {
  .hero-brand-wrap {
    height: 120px;
    margin-bottom: 1rem;
  }

  .hero-ctas .btn {
    width: 100%;
    justify-content: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  #hero-canvas {
    filter: none;
  }

  .hero.is-interacting #hero-canvas {
    filter: none;
  }
}

/* ---------- Home: what we do ---------- */

.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

.category-card {
  position: relative;
  overflow: hidden;
  text-align: left;
  cursor: pointer;
  width: 100%;
}

.category-card-icon {
  position: absolute;
  right: -1rem;
  bottom: -0.9rem;
  width: clamp(120px, 42%, 190px);
  height: auto;
  color: var(--accent-text);
  opacity: 0.16;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.4));
  pointer-events: none;
  transition: transform 0.3s var(--ease), color 0.3s var(--ease),
    filter 0.3s var(--ease), opacity 0.3s var(--ease);
}

.category-card > *:not(.category-card-icon) {
  position: relative;
  z-index: 1;
}

.category-card:hover .category-card-icon {
  transform: scale(1.07) rotate(-4deg);
  color: var(--accent-text-hover);
  filter: drop-shadow(0 2px 18px rgba(0, 0, 0, 0.45));
  opacity: 0.28;
}

@media (max-width: 720px) {
  .category-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Home: how we work ---------- */

.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
}

@media (max-width: 900px) {
  .steps-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .steps-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- Services ---------- */

.page-intro {
  padding-block: clamp(3.5rem, 8vw, 5.5rem) clamp(2rem, 5vw, 3rem);
}

.page-intro h1 {
  margin-top: 0.9rem;
  max-width: 20ch;
}

.page-intro p {
  margin-top: 1rem;
  color: var(--ink-dim);
  max-width: 56ch;
}

/* Service Category Tabs / Pills */
.pill-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
  margin-bottom: 2.5rem;
}

.pill-btn {
  padding: 0.65rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s var(--ease), color 0.25s var(--ease),
    background-color 0.25s var(--ease), box-shadow 0.25s var(--ease),
    transform 0.2s var(--ease);
}

/* Hover state: indigo accent */
.pill-btn:hover {
  border-color: var(--accent-text);
  color: var(--accent-text);
  box-shadow: var(--shadow-1);
  transform: translateY(-1px);
}

/* Selected state: indigo indicator */
.pill-btn.is-active,
.pill-btn[aria-selected="true"] {
  background: rgba(67, 52, 201, 0.18);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: var(--shadow-1);
}

.services-tab-container {
  position: relative;
  min-height: 480px;
}

.service-panel {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 320ms var(--ease), transform 320ms var(--ease);
}

.service-panel.is-active {
  opacity: 1;
  transform: translateY(0);
}

.service-panel.is-leaving {
  opacity: 0;
  transform: translateY(-10px);
}

.service-panel-header {
  margin-bottom: 2rem;
}

.service-panel-header h3 {
  font-size: var(--h2-size);
  margin-top: 0.5rem;
}

.service-panel-header p {
  color: var(--ink-dim);
  margin-top: 0.4rem;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 1.25rem;
}

@media (max-width: 560px) {
  .service-grid {
    grid-template-columns: 1fr;
  }
}

/* Service Card Background Images & Overlay Styling */
.service-card {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  padding: 1.75rem 1.6rem;
  border-radius: var(--radius);
  background-color: var(--panel);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), transform 0.3s var(--ease);
}

/* IMPORTANT: `opacity` must be set here — the base `.card::before` rule in
   components.css sets `opacity: 0` (it styles the card's top hairline), and
   without an explicit override the dark overlay below would never render. */
.service-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.45) 0%,
    rgba(0, 0, 0, 0.8) 100%
  );
  opacity: 1;
  z-index: 1;
  pointer-events: none;
  transition: background 0.3s var(--ease), opacity 0.3s var(--ease);
}

/* Hover: keep the artwork visible — a flat semi-transparent black veil (0.4–0.5)
   so the white card text stays clearly legible without hiding the image. */
.service-card:hover::before {
  background: rgba(0, 0, 0, 0.5);
}

/* Extra legibility guarantee for the white text on hover. */
.service-card:hover h3 {
  text-shadow: 0 2px 14px rgba(0, 0, 0, 1), 0 0 26px rgba(0, 0, 0, 0.75);
}

.service-card .card-content {
  position: relative;
  z-index: 2;
}

.service-card h3 {
  font-size: 1.35rem;
  color: #ffffff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.9);
}

.service-card p {
  color: #c8d0e5;
  font-size: 0.96rem;
  margin-top: 0.45rem;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.95);
}

.service-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-text);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* Category 1 Background Images */
.card-bg-design-1 { background-image: url('https://images.unsplash.com/photo-1626785774573-4b799315345d?auto=format&fit=crop&w=800&q=80'); }
.card-bg-design-2 { background-image: url('https://images.unsplash.com/photo-1600132806370-bf17e65e942f?auto=format&fit=crop&w=800&q=80'); }
.card-bg-design-3 { background-image: url('https://images.unsplash.com/photo-1611162617213-7d7a39e9b1d7?auto=format&fit=crop&w=800&q=80'); }
.card-bg-design-4 { background-image: url('https://images.unsplash.com/photo-1544716278-ca5e3f4abd8c?auto=format&fit=crop&w=800&q=80'); }
.card-bg-design-5 { background-image: url('https://images.unsplash.com/photo-1550745165-9bc0b252726f?auto=format&fit=crop&w=800&q=80'); }
.card-bg-design-6 { background-image: url('https://images.unsplash.com/photo-1561070791-2526d30994b5?auto=format&fit=crop&w=800&q=80'); }
.card-bg-design-7 { background-image: url('https://images.unsplash.com/photo-1551836022-d5d88e9218df?auto=format&fit=crop&w=800&q=80'); }

/* Category 2 Background Images */
.card-bg-eng-1 { background-image: url('https://images.unsplash.com/photo-1555066931-4365d14bab8c?auto=format&fit=crop&w=800&q=80'); }
.card-bg-eng-2 { background-image: url('https://images.unsplash.com/photo-1517694712202-14dd9538aa97?auto=format&fit=crop&w=800&q=80'); }
.card-bg-eng-3 { background-image: url('https://images.unsplash.com/photo-1558494949-ef010cbdcc31?auto=format&fit=crop&w=800&q=80'); }
.card-bg-eng-4 { background-image: url('https://images.unsplash.com/photo-1461749280684-dccba630e2f6?auto=format&fit=crop&w=800&q=80'); }
.card-bg-eng-5 { background-image: url('https://images.unsplash.com/photo-1556742049-0a670fc8077a?auto=format&fit=crop&w=800&q=80'); }
.card-bg-eng-6 { background-image: url('https://images.unsplash.com/photo-1526374965328-7f61d4dc18c5?auto=format&fit=crop&w=800&q=80'); }
.card-bg-eng-7 { background-image: url('https://images.unsplash.com/photo-1512941937669-90a1b58e7e9c?auto=format&fit=crop&w=800&q=80'); }
.card-bg-eng-8 { background-image: url('https://images.unsplash.com/photo-1607252650355-f7fd0460ccdb?auto=format&fit=crop&w=800&q=80'); }

/* Category 3 Background Images */
.card-bg-auto-1 { background-image: url('https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&w=800&q=80'); }
.card-bg-auto-2 { background-image: url('https://images.unsplash.com/photo-1451187580459-43490279c0fa?auto=format&fit=crop&w=800&q=80'); }
.card-bg-auto-3 { background-image: url('https://images.unsplash.com/photo-1504639725590-34d0984388bd?auto=format&fit=crop&w=800&q=80'); }
.card-bg-auto-4 { background-image: url('https://images.unsplash.com/photo-1526374870839-e155464bb9b2?auto=format&fit=crop&w=800&q=80'); }
.card-bg-auto-5 { background-image: url('https://images.unsplash.com/photo-1618005182384-a83a8bd57fbe?auto=format&fit=crop&w=800&q=80'); }
.card-bg-auto-6 { background-image: url('https://images.unsplash.com/photo-1460925895917-afdab827c52f?auto=format&fit=crop&w=800&q=80'); }

/* Category 4 Background Images */
.card-bg-motion-1 { background-image: url('https://images.unsplash.com/photo-1574717024653-61fd2cf4d44d?auto=format&fit=crop&w=800&q=80'); }
.card-bg-motion-2 { background-image: url('https://images.unsplash.com/photo-1550751827-4bd374c3f58b?auto=format&fit=crop&w=800&q=80'); }
.card-bg-motion-3 { background-image: url('https://images.unsplash.com/photo-1536240478700-b869070f9279?auto=format&fit=crop&w=800&q=80'); }
.card-bg-motion-4 { background-image: url('https://images.unsplash.com/photo-1518173946687-a4c8a383392e?auto=format&fit=crop&w=800&q=80'); }


/* ---------- About ---------- */

.about-lead {
  display: grid;
  gap: 1.5rem;
  max-width: 68ch;
}

.about-lead p {
  color: var(--ink-dim);
  font-size: 1.08rem;
}

.about-lead p strong {
  color: var(--ink);
  font-weight: 600;
}

.belief-list {
  display: grid;
  gap: 1.1rem;
  max-width: 68ch;
}

.belief {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1.1rem;
}

.belief:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.belief p {
  color: var(--ink-dim);
}

.belief p strong {
  color: var(--ink);
}

/* ---------- Contact ---------- */

.contact-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: clamp(2.5rem, 6vw, 4rem);
  align-items: start;
}

@media (max-width: 820px) {
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.contact-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
}

.contact-card + .contact-card {
  margin-top: 1.1rem;
}

.contact-card h3 {
  font-size: 1.05rem;
  margin-bottom: 0.6rem;
}

.contact-card p,
.contact-card a {
  font-size: 0.98rem;
  color: var(--ink-dim);
}

.contact-card a {
  color: var(--accent-text);
}

.contact-card li + li {
  margin-top: 0.4rem;
}
