/* ============================================================
   AFAM RESIDENCE — Dammam
   Palette drawn from the property itself:
   aubergine tower, brass signage, coral textiles, ivory stone
   ============================================================ */

:root {
  --aubergine: #43294e;
  --aubergine-deep: #2c1a34;
  --ink: #221726;
  --brass: #c6a14f;
  --brass-soft: #d8bc7c;
  --coral: #df7a5e;
  --ivory: #f7f3ec;
  --ivory-deep: #efe8db;
  --stone: #6d6360;
  --white: #ffffff;

  --font-display: "Marcellus", serif;
  --font-body: "Jost", sans-serif;

  --maxw: 1120px;
  --spine-w: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 300;
  color: var(--ink);
  background: var(--ivory);
  line-height: 1.65;
  font-size: 17px;
  padding-left: var(--spine-w);
}

img { display: block; max-width: 100%; }

a { color: inherit; }

::selection { background: var(--brass); color: var(--ink); }

/* ---------- Signature: the purple spine -----------
   Echoes the residence's aubergine corner tower.     */
.spine {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--spine-w);
  background: var(--aubergine);
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
}
.spine .mark {
  font-family: var(--font-display);
  color: var(--brass);
  font-size: 22px;
  letter-spacing: 1px;
  text-decoration: none;
  line-height: 1;
}
.spine .word {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: var(--brass-soft);
}
.spine .dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--coral);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(247, 243, 236, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(67, 41, 78, 0.14);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 28px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  text-decoration: none;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.brand .brand-name {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 0.06em;
  color: var(--aubergine);
}
.brand .brand-sub {
  font-size: 11px;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--brass);
}
.site-nav { display: flex; gap: 6px; }
.site-nav a {
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--ink);
  transition: background 0.2s ease, color 0.2s ease;
}
.site-nav a:hover { background: rgba(67, 41, 78, 0.08); }
.site-nav a.active {
  background: var(--aubergine);
  color: var(--ivory);
}
.site-nav a:focus-visible,
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 2px;
}
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: flex-end;
  color: var(--ivory);
  isolation: isolate;
  overflow: hidden;
}
.hero img.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(
    to top,
    rgba(34, 23, 38, 0.88) 0%,
    rgba(34, 23, 38, 0.35) 55%,
    rgba(34, 23, 38, 0.18) 100%
  );
}
.hero-content {
  max-width: var(--maxw);
  margin: 0 auto;
  width: 100%;
  padding: 110px 28px 64px;
}
.eyebrow {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 0.36em;
  text-transform: uppercase;
  color: var(--brass-soft);
  border-bottom: 1px solid var(--brass);
  padding-bottom: 8px;
  margin-bottom: 22px;
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.08;
  max-width: 15ch;
  margin-bottom: 18px;
}
.hero p.lede {
  max-width: 52ch;
  font-size: 18px;
  color: rgba(247, 243, 236, 0.88);
  margin-bottom: 32px;
}

/* Small page hero (inner pages) */
.hero.compact { min-height: 52vh; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 14px 28px;
  border-radius: 2px;
  transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: var(--font-body);
}
.btn:hover { transform: translateY(-2px); }
.btn-brass { background: var(--brass); color: var(--ink); }
.btn-brass:hover { background: var(--brass-soft); }
.btn-ghost {
  border-color: rgba(247, 243, 236, 0.6);
  color: var(--ivory);
}
.btn-ghost:hover { background: rgba(247, 243, 236, 0.12); }
.btn-aubergine { background: var(--aubergine); color: var(--ivory); }
.btn-aubergine:hover { background: var(--aubergine-deep); }
.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- Sections ---------- */
.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 88px 28px;
}
.section.tight { padding-top: 56px; padding-bottom: 56px; }
.section-head { max-width: 60ch; margin-bottom: 48px; }
.section-head .eyebrow {
  color: var(--coral);
  border-bottom-color: var(--coral);
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  color: var(--aubergine-deep);
  margin-bottom: 14px;
}
.section-head p { color: var(--stone); }

/* Dark band */
.band {
  background: var(--aubergine);
  color: var(--ivory);
}
.band .section-head h2 { color: var(--ivory); }
.band .section-head p { color: rgba(247, 243, 236, 0.78); }
.band .eyebrow { color: var(--brass-soft); border-bottom-color: var(--brass); }

/* ---------- Cards & grids ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 26px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 26px; }

.card {
  background: var(--white);
  border: 1px solid rgba(67, 41, 78, 0.1);
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.card .card-body { padding: 24px; flex: 1; }
.card h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  color: var(--aubergine-deep);
  margin-bottom: 8px;
}
.card p { color: var(--stone); font-size: 15.5px; }

.feature {
  background: var(--white);
  border: 1px solid rgba(67, 41, 78, 0.1);
  border-left: 3px solid var(--brass);
  border-radius: 4px;
  padding: 26px;
}
.feature h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 20px;
  color: var(--aubergine-deep);
  margin-bottom: 8px;
}
.feature p { color: var(--stone); font-size: 15.5px; }

.band .feature {
  background: rgba(247, 243, 236, 0.06);
  border-color: rgba(247, 243, 236, 0.14);
  border-left-color: var(--brass);
}
.band .feature h3 { color: var(--ivory); }
.band .feature p { color: rgba(247, 243, 236, 0.74); }

/* ---------- Split layout (image + text) ---------- */
.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 56px;
  align-items: center;
}
.split.reverse { direction: rtl; }
.split.reverse > * { direction: ltr; }
.split img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 18px 18px 0 rgba(67, 41, 78, 0.12);
}
.split h2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 38px);
  color: var(--aubergine-deep);
  line-height: 1.18;
  margin-bottom: 16px;
}
.split p { color: var(--stone); margin-bottom: 14px; }

/* ---------- Checklist ---------- */
.check-list { list-style: none; margin-top: 8px; }
.check-list li {
  position: relative;
  padding-left: 30px;
  margin-bottom: 11px;
  color: var(--ink);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 7px;
  width: 12px; height: 12px;
  background: var(--coral);
  border-radius: 50% 50% 50% 0;
}

/* ---------- Stats ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
  text-align: center;
}
.stat .num {
  font-family: var(--font-display);
  font-size: clamp(34px, 4vw, 52px);
  color: var(--brass);
  line-height: 1;
}
.stat .lbl {
  margin-top: 10px;
  font-size: 12.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(247, 243, 236, 0.78);
}

/* ---------- Distance table ---------- */
.distance-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid rgba(67,41,78,0.12); border-radius: 4px; overflow: hidden; }
.distance-table th, .distance-table td { text-align: left; padding: 16px 22px; }
.distance-table thead th {
  background: var(--aubergine);
  color: var(--ivory);
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.distance-table tbody tr + tr td { border-top: 1px solid rgba(67,41,78,0.1); }
.distance-table td.dist {
  font-family: var(--font-display);
  color: var(--coral);
  font-size: 19px;
  white-space: nowrap;
}

/* ---------- Quote ---------- */
.quote {
  border-left: 3px solid var(--brass);
  padding: 8px 0 8px 28px;
  max-width: 62ch;
}
.quote p {
  font-family: var(--font-display);
  font-size: clamp(20px, 2.6vw, 28px);
  line-height: 1.4;
  color: var(--aubergine-deep);
}
.quote .who {
  margin-top: 14px;
  font-size: 13px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--coral);
}
.band .quote p { color: var(--ivory); }

/* ---------- Gallery strip ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.gallery img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
}
.gallery figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--stone);
}

/* ---------- Contact ---------- */
.contact-panel {
  background: var(--white);
  border: 1px solid rgba(67,41,78,0.12);
  border-radius: 4px;
  padding: 36px;
}
.contact-panel h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 22px;
  color: var(--aubergine-deep);
  margin-bottom: 16px;
}
.contact-line { margin-bottom: 14px; }
.contact-line .lbl {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--coral);
  margin-bottom: 3px;
}
.contact-line a { color: var(--aubergine); text-decoration-color: var(--brass); }

.form-grid { display: grid; gap: 18px; }
.form-grid label {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--aubergine);
  margin-bottom: 6px;
}
.form-grid input, .form-grid textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 16px;
  padding: 13px 15px;
  border: 1px solid rgba(67,41,78,0.22);
  border-radius: 3px;
  background: var(--ivory);
  color: var(--ink);
}
.form-grid input:focus, .form-grid textarea:focus {
  outline: 2px solid var(--brass);
  outline-offset: 1px;
  border-color: var(--brass);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--aubergine-deep);
  color: rgba(247, 243, 236, 0.82);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 28px 36px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(247, 243, 236, 0.14);
}
.footer-grid .f-brand {
  font-family: var(--font-display);
  font-size: 26px;
  color: var(--brass);
}
.footer-grid .f-sub {
  font-size: 11px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: rgba(247,243,236,0.6);
  margin-bottom: 14px;
}
.footer-grid h4 {
  font-size: 12.5px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 400;
  color: var(--brass-soft);
  margin-bottom: 14px;
}
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 9px; font-size: 15px; }
.footer-grid a { text-decoration: none; }
.footer-grid a:hover { color: var(--brass-soft); }
.footer-bottom {
  padding-top: 26px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(247,243,236,0.5);
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .btn:hover { transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 920px) {
  .grid-3, .stat-row { grid-template-columns: repeat(2, 1fr); }
  .split, .footer-grid { grid-template-columns: 1fr; }
  .split { gap: 32px; }
  .gallery { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 680px) {
  :root { --spine-w: 38px; }
  body { font-size: 16px; }
  .header-inner { height: auto; padding: 14px 18px; flex-wrap: wrap; }
  .site-nav { width: 100%; overflow-x: auto; padding-bottom: 6px; }
  .site-nav a { white-space: nowrap; font-size: 12px; padding: 8px 11px; }
  .grid-3, .grid-2, .stat-row, .gallery { grid-template-columns: 1fr; }
  .section { padding: 60px 20px; }
  .hero-content { padding: 90px 20px 48px; }
  .spine .mark { font-size: 17px; }
  .spine .word { font-size: 9.5px; letter-spacing: 0.34em; }
}
