:root {
  /* Elevate Fatemi design system: navy and gold, ivory page, Fatemi green for service */
  --ink: #14213d; --navy: #0f2340; --navy-deep: #1c3a66; --gold: #d6a91a; --gold-ink: #8a6417; --gold-soft: #f3ead6;
  --bg: #f6f3ec; --card: #fffdf8; --muted: #4a5363; --line: #d9cfb8; --emerald: #1f5f4a;
  --ok: #1f5f4a; --err: #a3361f;
  --serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --lisan: "Fatemi Maqala", "Al Fatemi", "Noto Naskh Arabic", serif;
}
* , *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 var(--sans); }
a { color: var(--navy); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* header */
.top { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { color: #fff; text-decoration: none; font: 700 24px/1 var(--serif); letter-spacing: .18em; }
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand img { height: 28px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 22px; font-size: 15px; margin-left: auto; }
.nav a { display: flex; align-items: center; height: 34px; color: #dfe4ee; text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; line-height: 1; }
.nav a:hover, .nav a.on { color: #fff; border-bottom-color: var(--gold); }
.nav-group { position: relative; display: flex; align-items: center; height: 34px; }
.nav-group > a span { color: var(--gold); margin-left: 3px; }
.nav-menu { position: absolute; top: calc(100% + 10px); left: -16px; min-width: 170px; padding: 8px; border: 1px solid #ffffff24;
  border-radius: 8px; background: var(--navy); box-shadow: 0 16px 38px #0005; opacity: 0; visibility: hidden; transform: translateY(-5px);
  transition: opacity .16s, transform .16s, visibility .16s; }
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.nav-menu a { display: flex; height: auto; min-height: 34px; padding: 8px 10px; border: 0; border-radius: 5px; line-height: 1.25; }
.nav-menu a:hover, .nav-menu a:focus-visible { background: #ffffff12; border: 0; }
.nav-group:hover .nav-menu, .nav-group:focus-within .nav-menu { opacity: 1; visibility: visible; transform: none; }
.account-link { display: inline-flex; align-items: center; gap: 9px; color: #fff; text-decoration: none; font-size: 14px; font-weight: 600; white-space: nowrap; }
.account-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: var(--navy); border: 2px solid #fff3; font-size: 12px; letter-spacing: .04em; transition: transform .18s, box-shadow .18s; overflow: hidden; }
.account-avatar { width: 100%; height: 100%; object-fit: cover; display: block; }
.account-link:hover .account-icon { transform: translateY(-1px); box-shadow: 0 0 0 4px #d6a91a33; }
@media (max-width: 640px) { .account-link > span:last-child { display: none; } }
/* phones: the menu becomes a second row that scrolls sideways, and the whole bar stays pinned */
@media (max-width: 900px) {
  .top .wrap { flex-wrap: wrap; height: auto; padding-block: 10px 0; row-gap: 6px; }
  .nav { order: 3; width: 100%; margin: 0; overflow-x: auto; white-space: nowrap; gap: 20px; padding-bottom: 8px; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .nav::-webkit-scrollbar { display: none; }
  .nav-menu { display: none; }
}

/* hero */
.hero { background: linear-gradient(160deg, var(--navy) 0%, #1c3a66 100%); color: #fff; padding: 84px 0 76px; }
.hero h1 { font: 700 clamp(34px, 6vw, 56px)/1.1 var(--serif); margin: 0 0 18px; max-width: 760px; }
.hero p.lead { font-size: 20px; color: #d7deea; max-width: 680px; margin: 0 0 30px; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: 13px; color: var(--gold-ink); font-weight: 600; margin: 0 0 14px; }
.hero .eyebrow, .pagehead .eyebrow, .band .eyebrow { color: var(--gold); }
.btns { display: flex; flex-wrap: wrap; gap: 12px; }
.btn { display: inline-block; padding: 13px 22px; border-radius: 8px; font-weight: 600; text-decoration: none; border: 2px solid transparent; font-size: 16px; cursor: pointer; }
.btn.gold { background: var(--gold); color: var(--navy); }
.btn.ghost { border-color: #ffffff66; color: #fff; }
.btn.navy { background: var(--navy); color: #fff; }

/* sections */
section { padding: 72px 0; }
section.alt { background: var(--card); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
h2 { font: 700 34px/1.2 var(--serif); margin: 0 0 12px; color: var(--navy); }
.sub { color: var(--muted); max-width: 680px; margin: 0 0 36px; }
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 26px; }
.card h3 { font: 700 20px/1.3 var(--serif); margin: 6px 0 8px; color: var(--navy); }
.card p { margin: 0; color: var(--muted); font-size: 16px; }
.num { font: 700 13px/1 var(--sans); color: var(--gold-ink); letter-spacing: .14em; }

blockquote.kalam { margin: 0; padding: 36px 40px; background: var(--gold-soft); border-left: 4px solid var(--gold); border-radius: 0 12px 12px 0;
  font: italic 22px/1.55 var(--serif); color: var(--navy); }
blockquote.kalam cite { display: block; margin-top: 14px; font: normal 14px/1.5 var(--sans); color: var(--muted); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 18px; }
.stat { text-align: center; padding: 22px 10px; }
.stat b { display: block; font: 700 40px/1 var(--serif); color: var(--navy); }
.stat span { color: var(--muted); font-size: 15px; }

.band { background: var(--navy); color: #fff; border-radius: 16px; padding: 44px; display: flex; flex-wrap: wrap; gap: 24px; align-items: center; justify-content: space-between; }
.band h2 { color: #fff; }
.band p { color: #d7deea; margin: 0; max-width: 560px; }
.anchor-section { scroll-margin-top: 72px; }
.about-action { margin-top: 24px; }
.program-note { max-width: 700px; padding: 34px 0 10px; border-top: 3px solid var(--gold); }
.program-note h2 { max-width: 620px; }
.program-note p:not(.eyebrow) { max-width: 650px; color: var(--muted); }

footer { padding: 40px 0; color: var(--muted); font-size: 14px; border-top: 1px solid var(--line); }
footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }

/* forms */
.formpage { padding: 48px 0 72px; }
.formcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 34px; max-width: 760px; }
.tabs { display: flex; gap: 8px; margin: 0 0 24px; flex-wrap: wrap; }
.tabs button { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 9px 18px; font: 600 15px var(--sans); color: var(--muted); cursor: pointer; }
.tabs button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
fieldset { border: 0; padding: 0; margin: 0 0 22px; }
legend { font: 700 18px var(--serif); color: var(--navy); margin-bottom: 12px; }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.row.three { grid-template-columns: 1fr 2fr 2fr; }
@media (max-width: 640px) { .row, .row.three { grid-template-columns: 1fr; } .formcard { padding: 22px; } }
label { display: block; font-size: 14px; font-weight: 600; margin: 0 0 14px; }
label small { font-weight: 400; color: var(--muted); }
input, select, textarea { display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid #cfc8b8; border-radius: 8px; font: 16px var(--sans); background: #fff; color: var(--ink); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
textarea { min-height: 96px; resize: vertical; }
.checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 8px 16px; }
.checks label { font-weight: 400; display: flex; gap: 8px; align-items: center; margin: 0; }
.checks input { width: auto; margin: 0; }
.hp { position: absolute; left: -9999px; }
.msg { margin-top: 16px; padding: 12px 14px; border-radius: 6px; display: none; font-size: 14px; line-height: 1.45; border: 1px solid transparent; }
.msg.ok { display: block; background: #edf6f1; border-color: #b9d8c8; color: #174b3b; }
.msg.err { display: block; background: #fff8f6; border-color: #e2b8ae; border-left: 3px solid var(--err); color: #762615; }
.field-help { display: block; margin-top: 5px; font-size: 13px; font-weight: 400; }
.field-help.error { color: var(--err); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--err); box-shadow: 0 0 0 1px var(--err); }
.show-password { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.show-password input { width: 16px; height: 16px; margin: 0; accent-color: var(--navy); }
.text-button { border: 0; padding: 0; background: none; color: var(--navy); font: inherit; text-decoration: underline; cursor: pointer; }
.note { font-size: 14px; color: var(--muted); }

/* admin */
.admin { padding: 30px 20px; max-width: 1400px; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; background: #fff; font-size: 14px; }
th, td { text-align: left; padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.muted { color: var(--muted); }
.pushform { display: grid; gap: 10px; max-width: 520px; margin-bottom: 40px; }
.pushform input, .pushform textarea { padding: 10px; border: 1px solid #ccc; border-radius: 6px; font: inherit; }

.photos figure { margin: 0; }
.photos { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.photos img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; display: block; }
.photos figcaption { color: var(--muted); font-size: 14px; margin-top: 8px; }

/* the keel arch: the one Fatemi motif per page, on the navy head band */
.hero, .pagehead { position: relative; overflow: hidden; }
.hero::after, .pagehead::after { content: ""; position: absolute; right: max(2vw, calc(50% - 600px)); bottom: 0; width: 300px; height: 92%;
  background: url("/static/img/arches.svg") no-repeat right bottom / contain; opacity: .9; pointer-events: none; }
.hero .wrap, .pagehead .wrap { position: relative; z-index: 1; }
@media (max-width: 760px) { .hero::after, .pagehead::after { opacity: .18; } }
.pagehead { background: linear-gradient(160deg, var(--navy) 0%, var(--navy-deep) 100%); color: #fff; padding: 64px 0 56px; }
.pagehead h1 { font: 700 clamp(32px, 5vw, 48px)/1.1 var(--serif); margin: 0 0 14px; max-width: 720px; }
.pagehead p { color: #d7deea; font-size: 19px; max-width: 640px; margin: 0; }

.steps { display: grid; gap: 22px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); counter-reset: step; }
.steps .card::before { counter-increment: step; content: "Step " counter(step); display: block; font: 700 13px/1 var(--sans); color: var(--gold-ink); letter-spacing: .14em; text-transform: uppercase; }
.card.service { border-top: 4px solid var(--emerald); }
.tag { display: inline-block; font: 600 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 6px 10px; border-radius: 2px; background: var(--gold-soft); color: var(--gold-ink); margin-bottom: 10px; }
.tag.live { background: #e3efe9; color: var(--emerald); }
.timeline { display: grid; gap: 0; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline > div { position: relative; padding: 0 0 28px 28px; }
.timeline > div::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; background: var(--gold); transform: rotate(45deg); }
.timeline h3 { font: 700 20px/1.3 var(--serif); color: var(--navy); margin: 0 0 4px; }
.timeline p { margin: 0; color: var(--muted); }
.twocol { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }
@media (max-width: 760px) { .twocol { grid-template-columns: 1fr; } }
.lisan { font-family: var(--lisan); direction: rtl; }
a.card.link { display: block; text-decoration: none; color: inherit; }
a.card.link:hover { border-color: var(--gold); }
a.card.link h3::after { content: " \2192"; color: var(--gold-ink); }
@font-face { font-family: "Fatemi Maqala"; src: url("/static/fonts/FatemiMaqala-Regular.ttf") format("truetype"); font-display: swap; }
.translator textarea { min-height: 140px; }
.lisan-out { font: 30px/1.9 var(--lisan); direction: rtl; text-align: right; color: var(--navy); background: var(--card);
  border: 1px solid var(--line); border-radius: 6px; padding: 20px 24px; min-height: 90px; white-space: pre-wrap; }

/* profile */
.profile h2 { margin-top: 44px; }
.profile h2:first-of-type { margin-top: 0; }
.recs { display: grid; gap: 18px; margin-bottom: 14px; }
.rec .rechead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.rec .rechead h3 { margin: 0 0 12px; }
.rec dl.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px 24px; margin: 0 0 14px; }
.rec dt { font-size: 13px; color: var(--muted); }
.rec dd { margin: 2px 0 0; overflow-wrap: anywhere; white-space: pre-line; }
.rec .recactions { margin-top: 16px; display: flex; flex-wrap: wrap; gap: 10px; }
.rec.empty p { color: var(--muted); }
.btn.ghostnavy { background: transparent; border-color: var(--navy); color: var(--navy); }
.profilefoot { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.linkbtn { background: none; border: 0; padding: 0; font: 15px var(--sans); color: var(--err); text-decoration: underline; cursor: pointer; }
.signedin { background: var(--gold-soft); border-radius: 8px; padding: 12px 16px; margin: 0 0 20px; font-size: 15px; }
.pwchange { margin-top: 40px; }
.pwchange summary { cursor: pointer; font-weight: 600; color: var(--navy); margin-bottom: 16px; }
.profile-summary { display: flex; align-items: center; gap: 18px; margin-bottom: 24px; }
.profile-photo { width: 76px; height: 76px; border-radius: 50%; object-fit: cover; flex: none; border: 3px solid var(--gold-soft); }
.profile-initials { display: grid; place-items: center; background: var(--gold); color: var(--navy); font: 700 24px var(--serif); }
.profile-summary h2 { margin: 0 0 4px; }
.profile-summary p { margin: 0; color: var(--muted); }
.photo-button { position: relative; border: 0; padding: 0; border-radius: 50%; background: transparent; cursor: pointer; line-height: 0; }
.photo-pencil { position: absolute; right: -2px; bottom: 1px; display: grid; place-items: center; width: 27px; height: 27px; border-radius: 50%; background: var(--navy); color: #fff; border: 2px solid var(--card); font: 15px/1 var(--sans); }
.photo-button:hover .profile-photo, .photo-button:focus-visible .profile-photo { box-shadow: 0 0 0 3px var(--gold); }
.profile-edit { max-width: none; }
.profile-dialog { width: min(92vw, 520px); border: 1px solid var(--line); border-radius: 14px; padding: 28px; background: var(--card); color: var(--ink); }
.profile-dialog::backdrop { background: #071426aa; backdrop-filter: blur(3px); }
.dialog-close { float: right; border: 0; background: transparent; color: var(--muted); font-size: 30px; cursor: pointer; }
.crop-frame { width: min(360px, 100%); aspect-ratio: 1; margin: 18px auto; border-radius: 50%; overflow: hidden; background: #e8e4db; cursor: grab; touch-action: none; }
.crop-frame:active { cursor: grabbing; }
.crop-frame canvas { width: 100%; height: 100%; display: block; }
.profile-dialog input[type="range"] { padding: 0; }
.btn.danger { background: var(--err); color: #fff; }
.temppw { font: 700 30px/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .06em; background: var(--gold-soft); padding: 16px 20px; border-radius: 8px; display: inline-block; user-select: all; }
.admin td form { margin: 0; }
.admin .btn.ghostnavy { padding: 6px 12px; font-size: 14px; }

/* admin: membership progress */
.progress h2 { font-size: 26px; margin-top: 34px; }
.weekpick { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; margin: 8px 0 10px; }
.weekpick label { margin: 0; }
.weekpick input { width: auto; }
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin: 12px 0; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 16px 18px; }
.tile span { display: block; font-size: 14px; color: var(--muted); }
.tile b { display: block; font: 600 40px/1.1 var(--sans); color: var(--ink); margin: 4px 0; }
.tile small { color: var(--muted); font-size: 13px; }
.chartcard { padding: 18px; }
.trend { width: 100%; height: auto; display: block; }
.trend .grid { stroke: var(--line); stroke-width: 1; }
.trend .tick { fill: var(--muted); font: 12px var(--sans); }
.trend .val { fill: var(--ink); font: 600 13px var(--sans); }
.trend .bar path { fill: var(--navy); opacity: .35; }
.trend .bar.on path, .trend a:hover .bar path { opacity: 1; }
.trend .hit { fill: transparent; }
.trendtable, .breakdown table { background: none; }
.trendtable td, .breakdown td { padding: 6px 8px; }
td.n { text-align: right; font-variant-numeric: tabular-nums; width: 3em; }
.breakdowns { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.breakdown { padding: 18px; }
.barcell { width: 40%; }
.barcell span { display: block; height: 10px; background: var(--navy); border-radius: 0 4px 4px 0; }

/* account and onboarding */
.auth-shell { min-height: calc(100vh - 170px); padding: 64px 20px 84px; background: radial-gradient(circle at 85% 8%, var(--gold-soft), transparent 30%); }
.auth-panel { max-width: 660px; margin: 0 auto; }
.auth-panel h1, .onboarding h1 { font: 700 clamp(36px, 6vw, 54px)/1.05 var(--serif); color: var(--navy); margin: 0 0 14px; }
.auth-panel .formcard { max-width: none; box-shadow: 0 18px 60px #0f23400d; }
.mail-mark { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; background: var(--gold-soft); color: var(--gold-ink); margin-bottom: 14px; }
.onboarding { min-height: calc(100vh - 64px); background: linear-gradient(145deg, #f6f3ec, #fffdf8); padding: 52px 20px 90px; }
.onboarding-wrap { max-width: 820px; margin: 0 auto; }
.onboarding-progress { height: 5px; background: #e5ddca; border-radius: 99px; margin-bottom: 56px; overflow: hidden; }
.onboarding-progress span { display: block; height: 100%; width: 25%; background: var(--gold); transition: width .35s ease; }
.onboarding-step { padding: 0; }
.onboarding-step.arrive { animation: profile-arrive .38s ease both; }
@keyframes profile-arrive { from { opacity: 0; filter: blur(8px); transform: translateY(14px); } to { opacity: 1; filter: blur(0); transform: none; } }
.onboarding-step .sub { margin-bottom: 30px; }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(185px, 1fr)); gap: 11px; }
.choice { position: relative; margin: 0; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; height: 100%; padding: 15px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font-weight: 500; transition: border-color .18s, background .18s, transform .18s; }
.choice input:checked + span { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.choice:hover span { transform: translateY(-1px); border-color: var(--gold); }
.onboarding-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 24px; border-top: 1px solid var(--line); }
.onboarding-actions [data-next], .onboarding-actions [data-save] { margin-left: auto; }
.resume-note { color: var(--ok); font-size: 14px; }
@media (prefers-reduced-motion: reduce) { .onboarding-step.arrive { animation: none; } }
