/* islamichousing.com — design tokens */
:root {
  --ink: #23281f;
  --paper: #f8f3e7;
  --card: #fffdf8;
  --night: #0b382b;
  --deep: #14523f;
  --brass: #c29b44;
  --goldlight: #e7ce8c;
  --ivory: #f1e7ce;
  --mist: #e4dcc6;
  --sage: #6e7f72;
  --display: 'Marcellus', 'Times New Roman', serif;
  --body: 'Source Serif 4', Georgia, serif;
  --ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --lattice: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96'%3E%3Cg fill='none' stroke='%23f1e7ce' stroke-opacity='0.07'%3E%3Crect x='30' y='30' width='36' height='36'/%3E%3Crect x='30' y='30' width='36' height='36' transform='rotate(45 48 48)'/%3E%3C/g%3E%3C/svg%3E");
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 1.075rem;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--deep); text-decoration-color: var(--brass); text-underline-offset: 3px; }
a:hover { color: var(--brass); }
a:focus-visible { outline: 2px solid var(--brass); outline-offset: 3px; }

/* ---------- header (dark emerald bar on every page) ---------- */
.site-header {
  background: var(--night);
  background-image: var(--lattice);
  border-bottom: 3px solid var(--brass);
  padding: 1.05rem 1.5rem;
  position: sticky; top: 0; z-index: 100;
  transition: box-shadow .35s ease, padding .35s ease, background-color .35s ease;
}
.site-header.scrolled {
  padding: .7rem 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,.28);
}
.header-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  font-family: var(--display); font-size: 1.3rem; letter-spacing: .02em;
  color: var(--ivory); text-decoration: none;
}
.brand svg { flex: 0 0 auto; }
.brand:hover { color: var(--goldlight); }
.site-nav { display: flex; gap: 1.6rem; font-family: var(--ui); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.site-nav a { color: var(--goldlight); text-decoration: none; opacity: .9; }
.site-nav a:hover { color: #fff; opacity: 1; }

/* ---------- homepage hero ---------- */
@keyframes drift { from { background-position: 0 0; } to { background-position: 96px 96px; } }
@keyframes aurora {
  0%   { transform: translate(0,0) scale(1); }
  100% { transform: translate(4%,-5%) scale(1.1); }
}
@keyframes spin-slow { to { transform: rotate(360deg); } }
@keyframes shimmer { to { background-position: -200% center; } }
@keyframes float-y {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-16px) rotate(8deg); }
}
@keyframes fade-up {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero {
  background: linear-gradient(175deg, var(--night) 0%, var(--deep) 120%);
  background-color: var(--night);
  position: relative;
  padding: 5.5rem 1.5rem 9.5rem;
  text-align: center;
  color: var(--ivory);
  overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0; z-index: 0;
  background-image: var(--lattice);
  animation: drift 14s linear infinite;
  pointer-events: none;
}
.hero::after {
  content: ''; position: absolute; inset: -20%; z-index: 0;
  background:
    radial-gradient(circle at 18% 22%, rgba(226,196,122,.4), transparent 45%),
    radial-gradient(circle at 82% 74%, rgba(20,82,63,.55), transparent 50%);
  filter: blur(50px);
  animation: aurora 16s ease-in-out infinite alternate;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero .khatam {
  width: 60px; height: 60px; margin-bottom: 2rem;
  filter: drop-shadow(0 0 22px rgba(231,206,140,.55)) drop-shadow(0 2px 10px rgba(0,0,0,.35));
  animation: spin-slow 44s linear infinite;
}
.float-star {
  position: absolute; z-index: 1; opacity: .16; pointer-events: none;
  animation: float-y 9s ease-in-out infinite;
}
.float-star-1 { top: 14%; left: 9%; animation-delay: 0s; }
.float-star-2 { top: 68%; left: 87%; animation-delay: 1.6s; }
.float-star-3 { top: 80%; left: 14%; animation-delay: 3.2s; width: 30px; }
.hero h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(2.1rem, 5vw, 3.6rem);
  line-height: 1.16; letter-spacing: .005em;
  max-width: 21ch; margin: 0 auto .5rem;
  color: #fbf7ea;
  animation: fade-up .8s ease both;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--goldlight), var(--brass) 45%, var(--goldlight));
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 7s linear infinite;
}
.hero .dek {
  max-width: 54ch; margin: 1.35rem auto 0;
  color: #cfdcd0; font-size: 1.12rem;
  animation: fade-up .8s ease .12s both;
}
.hero-cta {
  display: inline-block; margin-top: 2.2rem; position: relative; overflow: hidden;
  font-family: var(--ui); font-size: .82rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--night); background: var(--goldlight);
  padding: .85rem 1.9rem; border-radius: 999px;
  text-decoration: none; transition: transform .2s ease, background .2s ease, box-shadow .2s ease;
  animation: fade-up .8s ease .24s both;
}
.hero-cta::after {
  content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,.75), transparent);
  transform: skewX(-20deg);
  transition: left .6s ease;
}
.hero-cta:hover {
  background: #fff; color: var(--night); transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(231,206,140,.45), 0 0 0 4px rgba(231,206,140,.18);
}
.hero-cta:hover::after { left: 130%; }

/* ---------- guide cards (overlap the hero) ---------- */
.guides {
  max-width: 1080px; margin: -6rem auto 0; padding: 0 1.5rem 3.5rem;
  position: relative;
}
.guides-head { text-align: center; margin-bottom: 1.75rem; }
.guides-head h2 {
  font-family: var(--ui); font-size: .8rem; font-weight: 600;
  letter-spacing: .16em; text-transform: uppercase; color: var(--goldlight);
}
.guides-head p { color: #cfdcd0; font-size: .95rem; margin-top: .3rem; }
.guide-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.25rem;
  counter-reset: guide;
}
.guide {
  display: flex; flex-direction: column;
  counter-increment: guide;
  background: var(--card);
  border: 1px solid var(--mist);
  border-radius: 10px;
  padding: 1.6rem 1.6rem 1.35rem;
  text-decoration: none; color: var(--ink);
  box-shadow: 0 10px 30px rgba(11, 56, 43, .12);
  position: relative; overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease;
}
.guide::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 4px; z-index: 1;
  background: linear-gradient(90deg, var(--brass), var(--goldlight), var(--brass));
  background-size: 220% auto;
  transform: scaleX(.22); transform-origin: left;
  transition: transform .3s ease;
}
.guide::after {
  content: counter(guide, decimal-leading-zero);
  position: absolute; top: -.5rem; right: .6rem; z-index: 0;
  font-family: var(--display); font-size: 3.4rem; line-height: 1;
  color: var(--mist); opacity: .55; pointer-events: none;
  transition: opacity .3s ease, transform .3s ease;
}
.guide > * { position: relative; z-index: 1; }
.guide:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 44px rgba(11, 56, 43, .2), 0 0 0 1px rgba(194, 155, 68, .28);
}
.guide:hover::before { transform: scaleX(1); animation: shimmer 2.2s linear infinite; }
.guide:hover::after { opacity: .85; transform: translateY(-4px); color: var(--goldlight); }
.guide .eyebrow {
  font-family: var(--ui); font-size: .72rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: var(--brass);
}
.guide h3 {
  font-family: var(--display); font-weight: 400; font-size: 1.38rem;
  line-height: 1.28; margin: .45rem 0 .5rem;
}
.guide p { color: var(--sage); font-size: .96rem; flex: 1; }
.guide .more {
  margin-top: 1.1rem; font-family: var(--ui); font-size: .78rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--deep);
  transition: color .2s ease, letter-spacing .2s ease;
}
.guide:hover h3 { color: var(--deep); }
.guide:hover .more { color: var(--brass); letter-spacing: .16em; }

/* ---------- scroll reveal (progressive enhancement, see main.js) ---------- */
html.js .reveal {
  opacity: 0; transform: translateY(26px);
  transition: opacity .7s ease, transform .7s ease;
}
html.js .reveal.is-visible { opacity: 1; transform: translateY(0); }
.guide-grid > .reveal:nth-child(1) { transition-delay: .02s; }
.guide-grid > .reveal:nth-child(2) { transition-delay: .08s; }
.guide-grid > .reveal:nth-child(3) { transition-delay: .14s; }
.guide-grid > .reveal:nth-child(4) { transition-delay: .2s; }
.guide-grid > .reveal:nth-child(5) { transition-delay: .26s; }
.guide-grid > .reveal:nth-child(6) { transition-delay: .32s; }
.guide-grid > .reveal:nth-child(7) { transition-delay: .38s; }
.guide-grid > .reveal:nth-child(8) { transition-delay: .44s; }
.trust-inner > .reveal:nth-child(1) { transition-delay: .05s; }
.trust-inner > .reveal:nth-child(2) { transition-delay: .15s; }
.trust-inner > .reveal:nth-child(3) { transition-delay: .25s; }

/* ---------- trust strip ---------- */
.trust {
  border-top: 1px solid var(--mist); border-bottom: 1px solid var(--mist);
  background: #fdfaf1;
  padding: 2.75rem 1.5rem;
}
.trust-inner {
  max-width: 1080px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  text-align: center;
}
.trust-inner > div { transition: transform .3s ease; }
.trust-inner > div:hover { transform: translateY(-3px); }
.trust-inner > div svg {
  box-sizing: content-box;
  background: var(--ivory); border-radius: 50%; padding: 13px;
  box-shadow: 0 8px 22px rgba(11, 56, 43, .15), inset 0 0 0 1px var(--mist);
  transition: transform .35s ease, box-shadow .35s ease;
}
.trust-inner > div:hover svg {
  transform: rotate(12deg) scale(1.1);
  box-shadow: 0 10px 26px rgba(194, 155, 68, .3), inset 0 0 0 1px var(--brass);
}
.trust h3 {
  font-family: var(--display); font-weight: 400; font-size: 1.2rem;
  color: var(--deep); margin: .65rem 0 .3rem;
}
.trust p { color: var(--sage); font-size: .93rem; max-width: 34ch; margin: 0 auto; }

/* ---------- dividers ---------- */
.rule {
  max-width: 1040px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1rem;
}
.rule::before, .rule::after { content: ''; flex: 1; height: 1px; background: var(--mist); }

/* ---------- article ---------- */
.article {
  max-width: 720px; margin: 0 auto; padding: 3.5rem 1.5rem 4rem;
}
.article .eyebrow {
  font-family: var(--ui); font-size: .74rem; font-weight: 600;
  letter-spacing: .13em; text-transform: uppercase; color: var(--brass);
}
.article h1 {
  font-family: var(--display); font-weight: 400;
  font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.2;
  margin: .5rem 0 .75rem;
}
.article .meta {
  font-family: var(--ui); font-size: .82rem; color: var(--sage);
  margin-bottom: 2.25rem; padding-bottom: 1.4rem;
  border-bottom: 3px double var(--brass);
}
.article h2 {
  font-family: var(--display); font-weight: 400; font-size: 1.6rem;
  line-height: 1.3; margin: 2.4rem 0 .8rem; color: var(--deep);
}
.article h3 {
  font-family: var(--display); font-weight: 400; font-size: 1.25rem;
  margin: 1.8rem 0 .6rem;
}
.article p { margin-bottom: 1.1rem; }
.article ul, .article ol { margin: 0 0 1.1rem 1.4rem; }
.article li { margin-bottom: .45rem; }
.article strong { color: var(--deep); }
.article blockquote {
  border-left: 3px solid var(--brass); padding: .25rem 0 .25rem 1.15rem;
  margin: 1.5rem 0; color: var(--sage); font-style: italic;
}
.article table {
  width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: .95rem;
  background: var(--card); border: 1px solid var(--mist); border-radius: 8px; overflow: hidden;
}
.article th, .article td {
  text-align: left; padding: .65rem .8rem; border-bottom: 1px solid var(--mist);
  vertical-align: top;
}
.article th {
  font-family: var(--ui); font-size: .74rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase; color: var(--ivory);
  background: var(--deep); border-bottom: 2px solid var(--brass);
}
.article tr:nth-child(even) td { background: #fbf7ec; }
.callout {
  background: var(--card); border: 1px solid var(--mist); border-left: 4px solid var(--brass);
  border-radius: 0 8px 8px 0;
  padding: 1.1rem 1.25rem; margin: 1.6rem 0; font-size: .96rem;
  box-shadow: 0 4px 14px rgba(11, 56, 43, .06);
}
.callout .label {
  font-family: var(--ui); font-size: .72rem; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--deep);
  display: block; margin-bottom: .35rem;
}
.article .divider { text-align: center; margin: 2.5rem 0; }

/* ---------- concept visualization (per-article diagram) ---------- */
.concept-viz {
  margin: .3rem 0 2.25rem;
  background: var(--card);
  border: 1px solid var(--mist);
  border-radius: 10px;
  padding: 1.6rem 1.5rem 1.3rem;
  box-shadow: 0 8px 24px rgba(11, 56, 43, .08);
}
.concept-viz svg { display: block; width: 100%; height: auto; }
.concept-viz svg text { font-family: var(--ui); }
.concept-viz svg .vz-label { font-size: 11.5px; fill: var(--sage); }
.concept-viz svg .vz-strong { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; fill: var(--deep); }
.concept-viz svg .vz-eyebrow { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; fill: var(--brass); }
.concept-viz svg .vz-title { font-family: var(--display); font-size: 15px; fill: var(--ink); }
.concept-viz .cap {
  text-align: center; margin-top: .85rem;
  font-family: var(--ui); font-size: .72rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--sage);
}
@media (max-width: 640px) {
  .concept-viz { padding: 1.25rem 1rem 1rem; }
}

/* ---------- provider outbound links ---------- */
.provider-link {
  display: inline-flex; align-items: center; gap: .4rem;
  margin: -.4rem 0 1.2rem;
  font-family: var(--ui); font-size: .78rem; font-weight: 600;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--deep); text-decoration: none;
  border: 1px solid var(--mist); border-radius: 999px;
  padding: .45rem .95rem;
  transition: color .2s ease, border-color .2s ease, background .2s ease, transform .2s ease;
}
.provider-link:hover {
  color: var(--night); background: var(--goldlight); border-color: var(--brass);
  transform: translateY(-1px);
}

/* ---------- disclaimer strip ---------- */
.disclaimer-strip {
  max-width: 720px; margin: 0 auto 3rem; padding: 0 1.5rem;
}
.disclaimer-strip .inner {
  border: 1px solid var(--mist); border-left: 4px solid var(--brass);
  background: var(--card); border-radius: 0 8px 8px 0;
  padding: .9rem 1.1rem;
  font-family: var(--ui); font-size: .8rem; line-height: 1.55; color: var(--sage);
}

/* ---------- footer (matches hero) ---------- */
.site-footer {
  background: var(--night);
  background-image: var(--lattice);
  border-top: 3px solid var(--brass);
  padding: 3rem 1.5rem 3.25rem;
  text-align: center;
  color: #cfdcd0;
}
.site-footer .khatam { margin-bottom: 1.25rem; }
.site-footer nav { display: flex; justify-content: center; gap: 1.75rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.site-footer nav a {
  font-family: var(--ui); font-size: .78rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--goldlight); text-decoration: none;
}
.site-footer nav a:hover { color: #fff; }
.site-footer .fineprint {
  max-width: 62ch; margin: 0 auto; font-family: var(--ui);
  font-size: .76rem; color: #9fb3a4; line-height: 1.6;
}

/* ---------- responsive ---------- */
@media (max-width: 760px) {
  .guide-grid { grid-template-columns: 1fr; }
  .trust-inner { grid-template-columns: 1fr; gap: 1.6rem; }
  .hero { padding: 3.75rem 1.25rem 8rem; }
}
@media (max-width: 640px) {
  .site-nav { gap: 1rem; font-size: .7rem; }
  .brand { font-size: 1.1rem; }
}
