/* ===== ARCHITECTURE PAGE ===== */

/* ---------- Hero ---------- */
.ar-hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 82vh;
  padding: calc(var(--header-h) + 4.5rem) 0 6rem;
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}

.ar-hero-bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  background: url('images/3d-elevation-image1-econ-construction-karachi.jpg') center / cover no-repeat, var(--woody-dark);
  animation: ar-zoom 16s ease-out forwards;
  will-change: transform;
}

@keyframes ar-zoom {
  from { transform: scale(1); }
  to   { transform: scale(1.1); }
}

.ar-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, rgba(30, 20, 12, 0.9) 0%, rgba(30, 20, 12, 0.64) 54%, rgba(30, 20, 12, 0.34) 100%);
}

.ar-crumbs {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1.8rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ar-crumbs a:hover { color: #fff; text-decoration: underline; }
.ar-crumbs [aria-current] { color: #e6cdb0; }

.ar-hero-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: #e6cdb0;
  margin-bottom: 1.2rem;
}

.ar-hero-title {
  max-width: 780px;
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin-bottom: 1.5rem;
}

.ar-hero-title span { color: #e6cdb0; }

.ar-hero-desc {
  max-width: 590px;
  font-size: 1.1rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 1.8rem;
}

.ar-hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  margin-bottom: 2.4rem;
}

.ar-hero-chips li {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ar-hero-chips svg { color: #e6cdb0; }

.ar-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.ar-btn-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.9rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 50px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background 0.3s ease, transform 0.3s ease, border-color 0.3s ease;
}

.ar-btn-glass:hover {
  background: rgba(255, 255, 255, 0.26);
  border-color: #fff;
  transform: translateY(-2px);
}

.ar-scroll {
  position: absolute;
  left: 50%;
  bottom: 28px;
  width: 26px;
  height: 42px;
  margin-left: -13px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-radius: 20px;
}

.ar-scroll span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  background: #fff;
  border-radius: 4px;
  animation: ar-wheel 1.8s ease-in-out infinite;
}

@keyframes ar-wheel {
  0%   { opacity: 0; transform: translateY(0); }
  30%  { opacity: 1; }
  100% { opacity: 0; transform: translateY(14px); }
}

/* ---------- Shared headings ---------- */
.ar-head {
  max-width: 680px;
  margin: 0 auto 3.4rem;
  text-align: center;
}

.ar-label {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.3em;
  color: var(--woody-light);
  margin-bottom: 1rem;
}

.ar-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.4vw, 3rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--black);
  margin-bottom: 1rem;
}

.ar-title span { color: var(--woody); }

.ar-desc {
  color: var(--text-muted);
  font-size: 1.05rem;
  line-height: 1.75;
}

/* ---------- Intro ---------- */
.ar-intro {
  padding: 6rem 0 5.5rem;
  background: #F8F4EE;
}

.ar-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.6rem;
}

.ar-point {
  padding: 2rem 1.8rem;
  background: #F8F4EE;
  border: 1px solid rgba(92, 64, 51, 0.1);
  border-radius: 24px;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.ar-point:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 45px rgba(62, 42, 34, 0.12);
}

.ar-point-ico {
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.2rem;
  color: #fff;
  background: var(--woody);
  border-radius: 16px;
}

.ar-point h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.ar-point p {
  font-size: 0.96rem;
  line-height: 1.75;
  color: var(--text-muted);
}

/* ---------- Quick jump bar ---------- */
.ar-subnav {
  position: sticky;
  top: var(--header-h);
  z-index: 900;
  background: rgba(248, 244, 238, 0.94);
  border-bottom: 1px solid rgba(92, 64, 51, 0.1);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.ar-subnav-inner {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.ar-subnav-inner::-webkit-scrollbar { display: none; }

.ar-subnav-list {
  display: flex;
  gap: 0.4rem;
  margin: 0 auto;          /* centers on wide screens, scrolls on small ones */
  padding: 0.75rem 0;
}

.ar-subnav-list a {
  display: block;
  padding: 0.5rem 1.1rem;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  color: #5b554f;
  border-radius: 50px;
  transition: background 0.3s ease, color 0.3s ease;
}

.ar-subnav-list a:hover {
  color: #fff;
  background: var(--woody);
}

.ar-subnav-list a:focus-visible {
  outline: 3px solid var(--woody-light);
  outline-offset: 2px;
}

/* ---------- Sections ---------- */
.ar-section {
  padding: 6.5rem 0 7rem;
  background: #F8F4EE;
  scroll-margin-top: calc(var(--header-h) + 60px);
}

.ar-section--dark { background: #F8F4EE; }

.ar-section--dark .ar-label { color: var(--woody-light); }
.ar-section--dark .ar-title { color: var(--black); }
.ar-section--dark .ar-title span { color: var(--woody); }
.ar-section--dark .ar-desc { color: var(--text-muted); }

/* ---------- Grid + card ---------- */
.ar-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.ar-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(92, 64, 51, 0.1);
  border-radius: 28px;
  box-shadow: 0 16px 40px rgba(62, 42, 34, 0.09);
  scroll-margin-top: calc(var(--header-h) + 90px);
  transition: transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1), box-shadow 0.5s ease, border-color 0.4s ease;
}

.ar-card:hover {
  transform: translateY(-8px);
  border-color: rgba(92, 64, 51, 0.28);
  box-shadow: 0 32px 65px rgba(62, 42, 34, 0.2);
}

/* Highlight when reached from the jump bar or a link */
.ar-card.ar-flash {
  animation: ar-flash 1.8s ease;
}

@keyframes ar-flash {
  0%   { box-shadow: 0 0 0 0 rgba(139, 107, 74, 0.75); }
  45%  { box-shadow: 0 0 0 12px rgba(139, 107, 74, 0.28); }
  100% { box-shadow: 0 0 0 0 rgba(139, 107, 74, 0); }
}

/* ---------- Carousel ---------- */
.ar-carousel {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #2a1c15;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.ar-carousel:focus-visible {
  outline: 3px solid var(--woody-light);
  outline-offset: -3px;
}

.ar-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.ar-slide {
  flex: 0 0 100%;
  height: 100%;
  display: flex;
  cursor: zoom-in;
}

.ar-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  user-select: none;
}

/* Drawings: light "blueprint" paper, image fully visible */
.ar-card--drawing .ar-carousel {
  background-color: #fbfaf7;
  background-image:
    linear-gradient(rgba(92, 64, 51, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(92, 64, 51, 0.06) 1px, transparent 1px);
  background-size: 22px 22px;
}

.ar-card--drawing .ar-slide { padding: 18px 18px 46px; }

.ar-card--drawing .ar-slide img {
  object-fit: contain;
  mix-blend-mode: multiply;     /* white backgrounds blend into the paper */
}

/* Image not found */
.ar-slide.is-missing {
  background: linear-gradient(135deg, var(--woody), var(--woody-dark));
  cursor: default;
}

.ar-slide.is-missing img { display: none; }

.ar-slide.is-missing::after {
  content: 'Image coming soon';
  margin: auto;
  font-size: 0.92rem;
  font-weight: 600;
  color: #e6cdb0;
}

/* Number tile */
.ar-num {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 3;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  background: var(--woody);
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  transition: transform 0.4s ease, background 0.3s ease;
}

.ar-card:hover .ar-num {
  transform: scale(1.08) rotate(-4deg);
  background: var(--woody-dark);
}

/* Counter (created by JS) */
.ar-count {
  position: absolute;
  top: 20px;
  right: 14px;
  z-index: 3;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: #fff;
  background: rgba(30, 20, 12, 0.55);
  border-radius: 50px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
}

/* Arrows (created by JS) */
.ar-nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 42px;
  height: 42px;
  margin-top: -21px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--woody-dark);
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.3s ease, background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

.ar-prev { left: 12px; }
.ar-next { right: 12px; }

.ar-nav:hover {
  background: var(--woody);
  color: #fff;
  transform: scale(1.08);
}

.ar-nav:focus-visible,
.ar-zoom:focus-visible,
.ar-dots button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

/* On computers, arrows appear when you hover the carousel */
@media (hover: hover) {
  .ar-nav { opacity: 0; }
  .ar-carousel:hover .ar-nav,
  .ar-carousel:focus-within .ar-nav { opacity: 1; }
}

/* Zoom button (created by JS) */
.ar-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(30, 20, 12, 0.55);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background 0.3s ease, transform 0.3s ease;
}

.ar-zoom:hover {
  background: var(--woody);
  transform: scale(1.08);
}

/* Dots (created by JS) */
.ar-dots {
  position: absolute;
  left: 50%;
  bottom: 14px;
  z-index: 3;
  display: flex;
  gap: 6px;
  padding: 7px 11px;
  transform: translateX(-50%);
  background: rgba(30, 20, 12, 0.5);
  border-radius: 50px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ar-dots button {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}

.ar-dots button.is-active {
  width: 20px;
  border-radius: 10px;
  background: #fff;
}

/* ---------- Card text ---------- */
.ar-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1.7rem 1.8rem 1.9rem;
}

.ar-body h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 0.8rem;
}

.ar-body > p {
  font-size: 0.95rem;
  line-height: 1.78;
  color: var(--text-muted);
  margin-bottom: 1.2rem;
}

.ar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.4rem;
}

.ar-tags li {
  padding: 0.32rem 0.85rem;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--woody-dark);
  background: #f0e3d2;
  border-radius: 50px;
}

.ar-body > .ar-note {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.8rem 1rem;
  margin-bottom: 1.4rem;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.55;
  color: var(--woody-dark);
  background: #f6efe5;
  border: 1px dashed rgba(92, 64, 51, 0.35);
  border-radius: 14px;
}

.ar-note svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--woody);
}

.ar-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  font-size: 0.93rem;
  font-weight: 700;
  color: var(--woody);
  transition: gap 0.3s ease, color 0.3s ease;
}

.ar-link:hover {
  gap: 14px;
  color: var(--woody-dark);
}

/* Dark section cards */
.ar-section--dark .ar-card {
  background: #fff;
  border-color: rgba(92, 64, 51, 0.1);
  box-shadow: 0 16px 40px rgba(62, 42, 34, 0.09);
}

.ar-section--dark .ar-card:hover {
  border-color: rgba(92, 64, 51, 0.28);
  box-shadow: 0 32px 65px rgba(62, 42, 34, 0.2);
}

.ar-section--dark .ar-body h3 { color: var(--black); }
.ar-section--dark .ar-body > p { color: var(--text-muted); }

.ar-section--dark .ar-tags li {
  color: var(--woody-dark);
  background: #f0e3d2;
}

.ar-section--dark .ar-link { color: var(--woody); }
.ar-section--dark .ar-link:hover { color: var(--woody-dark); }

/* ---------- Image viewer ---------- */
.ar-lb {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
}

.ar-lb[hidden] { display: none; }

.ar-lb-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 10, 6, 0.92);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.ar-lb-fig {
  position: relative;
  max-width: min(1100px, 84vw);
  margin: 0;
  animation: ar-pop 0.35s cubic-bezier(0.2, 0.7, 0.2, 1);
}

@keyframes ar-pop {
  from { opacity: 0; transform: scale(0.95) translateY(12px); }
  to   { opacity: 1; transform: none; }
}

.ar-lb-fig img {
  display: block;
  max-width: 100%;
  max-height: 78vh;
  margin: 0 auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.ar-lb-fig figcaption {
  margin-top: 0.9rem;
  text-align: center;
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.8);
}

.ar-lb-close,
.ar-lb-nav {
  position: absolute;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.ar-lb-close:hover,
.ar-lb-nav:hover { background: rgba(255, 255, 255, 0.3); }

.ar-lb-close {
  top: 18px;
  right: 18px;
  width: 46px;
  height: 46px;
  font-size: 1.8rem;
  line-height: 1;
}

.ar-lb-nav {
  top: 50%;
  width: 52px;
  height: 52px;
  margin-top: -26px;
}

.ar-lb-prev { left: 18px; }
.ar-lb-next { right: 18px; }

.ar-lb-close:focus-visible,
.ar-lb-nav:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* ---------- Reveal on scroll ---------- */
.ar-reveal {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.ar-reveal.ar-in {
  opacity: 1;
  transform: none;
}

/* Keep the hover lift working after the reveal */
.ar-card.ar-reveal.ar-in {
  transition:
    opacity 0.8s ease,
    transform 0.5s cubic-bezier(0.2, 0.7, 0.2, 1),
    box-shadow 0.5s ease,
    border-color 0.4s ease;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .ar-grid { grid-template-columns: repeat(2, 1fr); }
  .ar-points { grid-template-columns: 1fr; max-width: 560px; margin-inline: auto; }
}

@media (max-width: 768px) {
  .ar-hero {
    min-height: 74vh;
    padding: calc(var(--header-h) + 3rem) 0 5rem;
  }

  .ar-intro { padding: 4.8rem 0 4.5rem; }
  .ar-section { padding: 4.8rem 0 5.2rem; }
  .ar-head { margin-bottom: 2.6rem; }
}

@media (max-width: 640px) {
  .ar-grid { grid-template-columns: 1fr; gap: 1.8rem; }

  .ar-hero-actions { flex-direction: column; }
  .ar-hero-actions .btn,
  .ar-btn-glass { width: 100%; }
  .ar-scroll { display: none; }

  .ar-subnav-list { margin: 0; }

  .ar-body { padding: 1.5rem 1.4rem 1.7rem; }

  /* Viewer buttons move to the bottom on phones */
  .ar-lb-fig { max-width: 94vw; }
  .ar-lb-fig img { max-height: 68vh; }
  .ar-lb-nav { top: auto; bottom: 22px; margin-top: 0; }
  .ar-lb-prev { left: calc(50% - 66px); }
  .ar-lb-next { right: calc(50% - 66px); }
}

@media (prefers-reduced-motion: reduce) {
  .ar-hero-bg { animation: none; }
  .ar-scroll span { animation: none; opacity: 1; }
  .ar-reveal { opacity: 1; transform: none; transition: none; }
  .ar-track { transition: none; }
  .ar-card, .ar-card.ar-flash { animation: none; transition: none; }
  .ar-lb-fig { animation: none; }
}