:root {
  /* the site is always light; "only" also stops browsers from auto-darkening it */
  color-scheme: only light;
  --bg: #faf8f5;
  --text: #1f1d1a;
  --muted: #6b665e;
  --accent: #841f21; /* ISKAYAA brand red, sampled from the business card */
  --rule: #e4dfd7;
  --header-bg: rgba(250, 248, 245, 0.92);
  --max: 44rem;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* Arabic page: Arabic fonts first, Latin fonts for the few Latin words (language names, email) */
html:lang(ar) {
  --serif: "Noto Naskh Arabic", "EB Garamond", serif;
  --sans: "IBM Plex Sans Arabic", "Source Sans 3", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  /* keeps a jumped-to section (the hero's button goes to #contact) clear of the sticky header */
  scroll-padding-top: 5.5rem;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.125rem/1.65 var(--sans);
}

/* Arabic needs more room between lines for its tall letters and marks */
html:lang(ar) body {
  font-size: 1.1875rem;
  line-height: 1.85;
}

a { color: var(--accent); }

h1, h2 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
}

html:lang(ar) h1,
html:lang(ar) h2 {
  font-weight: 600;
  line-height: 1.4;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* language switcher: the end of the header bar, so it stays in reach while scrolling */

.langs ul {
  display: flex;
  gap: 0.25rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}

.langs a {
  color: var(--muted);
  text-decoration: none;
}

.langs a:hover,
.langs a:focus-visible {
  color: var(--accent);
}

/* the Arabic label uses the Arabic page's body face on every page, not a system fallback */
.langs a:lang(ar) {
  font-family: "IBM Plex Sans Arabic", var(--sans);
}

.langs a[aria-current] {
  color: var(--text);
  font-weight: 600;
}

/* header */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--header-bg);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}

/* the bar: the logo at the start, the language switcher at the end, one row at every width */
header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
}

/* ISKAYAA logo: the emblem with the Barlow wordmark beside it. A logo is never mirrored, so the
   lockup stays left to right on the Arabic page too. */
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  direction: ltr;
  color: var(--accent);
  text-decoration: none;
}

.brand img {
  display: block;
  width: 3rem;
  height: 3rem;
}

.wordmark {
  display: flex;
  flex-direction: column;
}

/* 0.205em tracking makes ISKAYAA exactly as wide as IMMIGRATION below it, so the wordmark is a squared block */
.wordmark-name {
  font: 600 1.95rem/1 "Barlow Condensed", sans-serif;
  letter-spacing: 0.205em;
}

.wordmark-sub {
  margin-top: 0.36rem;
  font: 500 0.675rem/1 "Barlow", sans-serif;
  letter-spacing: 0.6em;
}

/* phones: a slimmer bar and a smaller logo, so it fits beside the language switcher at 320px */
@media (max-width: 36rem) {
  header .wrap {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
  }
  .brand { gap: 0.625rem; }
  .brand img { width: 2.25rem; height: 2.25rem; }
  .wordmark-name { font-size: 1.375rem; }
  /* the desktop ratio to the name, so the two lines stay equal */
  .wordmark-sub { margin-top: 0.3rem; font-size: 0.476rem; }
}

/* sections */
/* hero: the tagline as the page's main heading, its second half in brand red as on the business card, then a line
   of support and the call to get in touch; the name lives in the logo */
.hero {
  padding-top: 2.25rem;
  padding-bottom: 2.25rem;
}

.hero h1 {
  max-width: 34rem;
  margin: 0 0 0.75rem;
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  line-height: 1.2;
  text-wrap: balance; /* if a half still wraps on a narrow phone, no word is left alone on a line */
}

/* two lines, as on the business card: the first half, then the red half below it */
.hero h1 span {
  display: block;
  color: var(--accent);
}

.hero p {
  max-width: 34rem;
  margin: 0 0 1.25rem;
  color: var(--muted);
}

.hero p:last-child {
  margin-bottom: 0;
}

/* his registered name, prominent near the top of every page (College Code of Professional Conduct, s. 44(1)(a)) */
.hero strong {
  color: var(--text);
  font-weight: 600;
}

.button {
  display: inline-block;
  padding: 0.625rem 1.25rem;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: #6b181a;
}

section {
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}

section h2 {
  margin: 0 0 1rem;
  font-size: 1.75rem;
}

/* About: the emblem beside the text; grid columns follow dir, so the Arabic page mirrors */
.about {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 1.25rem 2rem;
  align-items: start;
}

.about-emblem {
  display: block;
  width: 100%;
  height: auto;
}

.about p:first-child { margin-top: 0; }

/* Services: icon beside text, two columns, one on phones */
.services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.services li {
  display: grid;
  grid-template-columns: 3.5rem 1fr;
  gap: 0 1rem;
  align-items: start;
}

.services img {
  display: block;
  width: 3.5rem;
  height: auto;
}

.services h3 {
  margin: 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.services p {
  margin: 0;
  color: var(--muted);
}

@media (max-width: 36rem) {
  .about { grid-template-columns: 1fr; }
  .about-emblem { max-width: 9rem; }
  .services { grid-template-columns: 1fr; }
}

/* How it works: four numbered steps, two columns, one on phones; each number sits in the emblem's eight-point
   star, in its teal */
.steps {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  display: grid;
  grid-template-columns: 2.75rem 1fr;
  gap: 0 1rem;
  align-items: start;
  counter-increment: step;
}

.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  background: #2e7f70;
  color: #f6ecd6;
  font: 600 1.125rem/1 var(--sans);
  clip-path: polygon(50% 0%, 35.4% 14.6%, 14.6% 14.6%, 14.6% 35.4%, 0% 50%, 14.6% 64.6%, 14.6% 85.4%, 35.4% 85.4%,
    50% 100%, 64.6% 85.4%, 85.4% 85.4%, 85.4% 64.6%, 100% 50%, 85.4% 35.4%, 85.4% 14.6%, 64.6% 14.6%);
}

.steps h3 {
  margin: 0.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
}

.steps p {
  margin: 0;
  color: var(--muted);
}

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

/* FAQ: each question a native <details> dropdown, no JavaScript. The summary is a flex row, so the chevron sits at
   the line's end and moves to the left on the Arabic page by itself. */
.faq details {
  border-bottom: 1px solid var(--rule);
}

.faq details:first-child {
  border-top: 1px solid var(--rule);
}

/* the section divider below closes the list, so a line here would double it */
.faq details:last-child {
  border-bottom: none;
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none; /* hides the browser's own triangle */
}

.faq summary::-webkit-details-marker {
  display: none; /* Safari's triangle */
}

/* a chevron: two borders of a square, turned to point down, and up when open. It is symmetric, so the physical
   borders are fine on the Arabic page. */
.faq summary::after {
  content: "";
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  margin-inline-end: 0.25rem;
  border: solid var(--muted);
  border-width: 0 2px 2px 0;
  transform: translateY(-25%) rotate(45deg);
}

.faq details[open] > summary::after {
  transform: translateY(25%) rotate(-135deg);
}

@media (prefers-reduced-motion: no-preference) {
  .faq summary::after { transition: transform 0.2s; }
}

.faq summary:hover,
.faq summary:focus-visible {
  color: var(--accent);
}

.faq summary:hover::after,
.faq summary:focus-visible::after {
  border-color: var(--accent);
}

.faq details p {
  margin: 0 0 1rem;
  color: var(--muted);
}

/* RCIC insignia, on the same two-column grid as the steps and services above: the insignia centered in the first
   column, Said's name and the verify-status line starting at the second column's edge, as in the College's guide
   (name and line right beside the insignia); clear space all round, nothing added to the insignia, and no other logo
   or business name near it (rules in AGENTS.md). On phones the two stack, like the steps. */
.insignia {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem 2rem;
  align-items: center;
  margin-top: 2rem;
}

.insignia img {
  display: block;
  justify-self: center;
  width: 15rem;
  max-width: 100%;
  height: auto;
}

@media (max-width: 36rem) {
  .insignia { grid-template-columns: 1fr; }
  .insignia img { justify-self: start; }
}

.insignia p {
  margin: 0;
}

.insignia-name {
  font-weight: 600;
}

/* the verify-status line, linked to the College's public register: secondary gray like the nav, brand red only on
   hover or keyboard focus */
.insignia p + p {
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.4;
}

.insignia a {
  color: var(--muted);
  text-decoration: none;
}

.insignia a:hover,
.insignia a:focus-visible {
  color: var(--accent);
}

/* contact: on the same two-column grid as the steps and the insignia block below, so the QR card starts on the
   second column's line, in line with Said's name under it; the list is centered on the white card (the caption
   hangs below the card, so it does not pull the centering down). Below 48rem the columns are too narrow for the
   list, so the card drops below it. */
.contact {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* equal halves even when the list is a little wider */
  align-items: center;
  gap: 1.5rem 2rem;
  margin-bottom: 4.5rem; /* room for the QR caption hanging below the card */
}

@media (max-width: 48rem) {
  .contact { grid-template-columns: 1fr; }
  .contact .contact-list dd { white-space: normal; } /* outranks the one-line rule further down */
}

/* each row: an icon (phone, mail, pin, as on the business card) and its value. The label is still there for
   screen readers, visually hidden beside the icon. */
.contact-list {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin: 0;
}

.contact-list dt {
  display: flex;
  color: var(--muted);
}

.contact-icon {
  display: block;
  width: 1.125rem;
  height: 1.125rem;
}

/* hidden on screen, still read aloud */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* side by side with the QR, each value stays on one line. Once the contact area is a single column, values may wrap,
   and the email address must never push the page sideways. */
.contact-list dd {
  margin: 0;
  white-space: nowrap;
  overflow-wrap: anywhere;
}

/* "(WhatsApp)" after the Canadian number: a note on the number, not a link */
.contact-note {
  color: var(--muted);
}

/* phones: a size smaller, so the longest email (the Arabic page sets text larger) fits beside its icon at 320px */
@media (max-width: 36rem) {
  .contact-list { font-size: 1rem; }
}

/* the last row, "Add to contacts", links to Said's contact card (a .vcf file). It shows only on phones, where the QR
   code is hidden; wider screens scan the QR instead. */
.contact-list .add-contact {
  display: none;
}

@media (max-width: 36rem) {
  .contact-list dt.add-contact { display: flex; }
  .contact-list dd.add-contact { display: block; }
}

/* the one action in a list of details, so it reads as something to tap */
.contact-list dd.add-contact a {
  font-weight: 600;
}

/* the contact card as a QR code, in the second column */
.qr {
  justify-self: start;
  position: relative;
  width: 9.5rem;
  margin: 0;
  text-align: center;
  font-size: 0.8125rem; /* the same fine print as the verify-status line */
  line-height: 1.4;
  color: var(--muted);
}

.qr figcaption {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 0.5rem;
}

/* scanners read dark squares on white most reliably */
.qr img {
  display: block;
  width: 100%;
  height: auto;
  background: #fff;
  border-radius: 6px;
}

/* a phone cannot scan its own screen; the phone numbers and the Add to contacts row cover phones */
@media (max-width: 36rem) {
  .qr { display: none; }
  .contact { margin-bottom: 0; }
}

footer {
  padding: 1.25rem 0 1.5rem; /* a single line of fine print */
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.875rem;
  text-align: center;
}
