/* ==========================================================================
   Bnei Moshe of Kensington — design system
   Direction: "Shaar" (the gate). Navy tuned to the Kupat Rabbi Yehuda bar
   Illue mark so the two logos sit together without fighting.
   ========================================================================== */

:root {
  /* Fixed brand colors — identical in both themes. Used for filled surfaces. */
  --brand:        #1F3B70;
  --brand-deep:   #12294A;
  --on-brand:     #F7F4EC;
  --accent:       #B08536;

  /* Role tokens — these shift between light and dark. */
  --brand-text:   #1F3B70;
  --accent-text:  #8F6A24;
  --paper:        #FBF9F4;
  --surface:      #FFFFFF;
  --raised:       #F2EDE1;
  --ink:          #191C21;
  --muted:        #59524A;
  --faint:        #857C6E;
  --rule:         #E5DFD1;
  --shadow-sm:    0 1px 2px rgba(25, 28, 33, .05);
  --shadow-md:    0 1px 2px rgba(25, 28, 33, .05), 0 10px 28px -14px rgba(18, 41, 74, .28);

  --measure:      66ch;
  --gutter:       clamp(20px, 4vw, 32px);
  --shell:        1120px;
  --radius:       4px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand-text:  #93B3E6;
    --accent-text: #D9AC55;
    --paper:       #0F1218;
    --surface:     #161A21;
    --raised:      #1D232C;
    --ink:         #F1EEE7;
    --muted:       #A8A196;
    --faint:       #857C6E;
    --rule:        #29303A;
    --shadow-sm:   0 1px 2px rgba(0, 0, 0, .4);
    --shadow-md:   0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .8);
  }
}

:root[data-theme="dark"] {
  --brand-text:  #93B3E6;
  --accent-text: #D9AC55;
  --paper:       #0F1218;
  --surface:     #161A21;
  --raised:      #1D232C;
  --ink:         #F1EEE7;
  --muted:       #A8A196;
  --faint:       #857C6E;
  --rule:        #29303A;
  --shadow-sm:   0 1px 2px rgba(0, 0, 0, .4);
  --shadow-md:   0 1px 2px rgba(0, 0, 0, .4), 0 10px 28px -14px rgba(0, 0, 0, .8);
}

/* --------------------------------------------------------------- reset -- */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; }
img { height: auto; display: block; }

a { color: var(--brand-text); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-text); }

:focus-visible {
  outline: 2px solid var(--brand-text);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--brand); color: var(--on-brand); padding: 12px 20px;
}
.skip:focus { left: 0; }

/* ---------------------------------------------------------- typography -- */

h1, h2, h3, h4 {
  font-family: "EB Garamond", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.012em;
  margin: 0;
  text-wrap: balance;
  color: var(--ink);
}

h1 { font-size: clamp(34px, 5.4vw, 56px); }
h2 { font-size: clamp(27px, 3.6vw, 38px); }
h3 { font-size: clamp(20px, 2.2vw, 24px); }
h4 { font-size: 18px; }

p { margin: 0; }

.eyebrow {
  font-family: "Public Sans", sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin: 0;
}

.lede { font-size: clamp(18px, 2.1vw, 21px); color: var(--muted); max-width: var(--measure); }

.prose { max-width: var(--measure); display: flex; flex-direction: column; gap: 20px; }
.prose p { color: var(--muted); }
.prose h3 { margin-top: 12px; }
.prose ul { margin: 0; padding-left: 22px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; }

/* -------------------------------------------------------------- layout -- */

.shell { max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.shell--narrow { max-width: 840px; }

.band { padding-block: clamp(56px, 8vw, 88px); }
.band--tight { padding-block: clamp(40px, 5vw, 56px); }
.band--raised { background: var(--raised); }
.band--navy { background: var(--brand-deep); color: var(--on-brand); }
.band--navy h2, .band--navy h3 { color: var(--on-brand); }
.band--navy .eyebrow { color: var(--accent); }
.band--navy p { color: rgba(247, 244, 236, .78); }
.band--navy a { color: #F0E2C4; }

.stack { display: flex; flex-direction: column; gap: 20px; }
.stack--lg { gap: 32px; }

.section-head { display: flex; flex-direction: column; gap: 12px; max-width: var(--measure); margin-bottom: 36px; }

/* ------------------------------------------------------------ buttons --- */

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: "Public Sans", sans-serif;
  font-size: 15px; font-weight: 700; letter-spacing: .01em;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn--primary { background: var(--brand); color: var(--on-brand); }
.btn--primary:hover { background: var(--brand-deep); color: var(--on-brand); }

.btn--accent { background: var(--accent); color: #17110A; }
.btn--accent:hover { background: #C6983F; color: #17110A; }

.btn--outline { border-color: var(--rule); color: var(--brand-text); background: transparent; }
.btn--outline:hover { border-color: var(--brand-text); color: var(--brand-text); }

.btn--onnavy { background: var(--accent); color: #17110A; }
.btn--onnavy:hover { background: #C6983F; color: #17110A; }

.btn--ghost-onnavy { border-color: rgba(247, 244, 236, .35); color: var(--on-brand); background: transparent; }
.btn--ghost-onnavy:hover { border-color: var(--on-brand); color: var(--on-brand); }

.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ------------------------------------------------------------- header --- */

.topbar {
  background: var(--brand-deep);
  color: rgba(247, 244, 236, .8);
  font-size: 13.5px;
}
.topbar .shell {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 40px; flex-wrap: wrap; padding-block: 8px;
}
.topbar a { color: var(--on-brand); text-decoration: none; }
.topbar a:hover { color: var(--accent); text-decoration: underline; }
.topbar__note { color: rgba(247, 244, 236, .62); }

.masthead {
  background: var(--surface);
  border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 30;
}
.masthead .shell {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  min-height: 78px; padding-block: 12px;
}

.brand { display: flex; align-items: center; gap: 13px; text-decoration: none; flex: none; }
.brand__mark { flex: none; }
.brand__type { display: flex; flex-direction: column; gap: 1px; }
.brand__name {
  font-family: "EB Garamond", Georgia, serif; font-weight: 600;
  font-size: 22px; line-height: 1.05; color: var(--brand-text); letter-spacing: -.005em;
}
.brand__sub {
  font-size: 9.5px; font-weight: 700; letter-spacing: .19em; text-transform: uppercase;
  color: var(--accent-text);
}

.nav { display: flex; align-items: center; gap: 28px; }
.nav__list { display: flex; align-items: center; gap: 26px; list-style: none; margin: 0; padding: 0; }
.nav__list a {
  font-size: 15px; font-weight: 500; color: var(--muted); text-decoration: none;
  padding-block: 6px; border-bottom: 2px solid transparent;
}
.nav__list a:hover { color: var(--brand-text); }
.nav__list a[aria-current="page"] { color: var(--brand-text); border-bottom-color: var(--accent); }

.nav-toggle {
  display: none; background: none; border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 9px 12px; cursor: pointer; color: var(--ink); font: inherit; font-size: 14px; font-weight: 600;
}

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    background: var(--surface); border-bottom: 1px solid var(--rule);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 8px var(--gutter) 20px; box-shadow: var(--shadow-md);
  }
  .nav.is-open { display: flex; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__list a { display: block; padding: 13px 0; border-bottom: 1px solid var(--rule); }
  .nav__list a[aria-current="page"] { border-bottom-color: var(--rule); }
  .nav .btn { margin-top: 16px; justify-content: center; }
}

/* --------------------------------------------------------------- hero --- */

.hero { position: relative; overflow: hidden; background: var(--paper); }
.hero__inner {
  position: relative; z-index: 2;
  padding-block: clamp(60px, 9vw, 104px);
  display: flex; flex-direction: column; gap: 26px;
  max-width: 720px;
}
.hero h1 { color: var(--brand-text); }
.hero__arch {
  position: absolute; right: -60px; bottom: -40px; z-index: 1;
  width: min(46vw, 460px); opacity: .09; pointer-events: none;
  color: var(--brand);
}
@media (max-width: 760px) { .hero__arch { right: -110px; opacity: .06; } }

/* -------------------------------------------------------------- cards --- */

.grid { display: grid; gap: 18px; }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 26px 26px 28px;
  display: flex; flex-direction: column; gap: 10px;
}
.card__icon { color: var(--accent-text); margin-bottom: 4px; }
.card h3 { font-size: 21px; }
.card p { color: var(--muted); font-size: 15.5px; }

/* A plain list of points — deliberately not a card, so cards keep meaning. */
.points { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.point { display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 2px solid var(--accent); }
.point h3 { font-size: 20px; }
.point p { color: var(--muted); font-size: 15.5px; }

/* Nested text inside a navy band. These selectors are more specific than the
   generic `.band--navy p` above, which the card/point rules would otherwise
   win on source order alone. */
.band--navy .point p,
.band--navy .card p,
.band--navy .steps p,
.band--navy .callout p,
.band--navy .note { color: rgba(247, 244, 236, .76); }
.band--navy .point h3,
.band--navy .card h3 { color: var(--on-brand); }
.band--navy .lede { color: rgba(247, 244, 236, .8); }

/* --------------------------------------------------------- partnership -- */

.partner {
  display: grid; grid-template-columns: minmax(160px, 220px) 1fr; gap: 36px; align-items: center;
}
@media (max-width: 720px) { .partner { grid-template-columns: 1fr; gap: 24px; } }
.partner__logo {
  background: #FFFFFF; border-radius: var(--radius); padding: 22px;
  display: grid; place-items: center; min-height: 150px;
}
.partner__logo img { max-height: 130px; width: auto; }
.partner__logo .placeholder {
  font-family: "Public Sans", sans-serif; font-size: 12px; line-height: 1.5;
  color: #6B6459; text-align: center;
}

/* --------------------------------------------------------------- steps -- */

.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: flex; flex-direction: column; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 44px 1fr; gap: 4px 20px;
  padding: 22px 0; border-bottom: 1px solid var(--rule);
}
.steps li::before {
  content: counter(step);
  grid-row: 1 / 3;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--brand); color: var(--on-brand);
  font-family: "Public Sans", sans-serif; font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.steps h3 { font-size: 20px; align-self: center; }
.steps p { color: var(--muted); font-size: 15.5px; margin-top: 6px; }
.band--navy .steps li { border-bottom-color: rgba(247, 244, 236, .16); }
.band--navy .steps li::before { background: var(--accent); color: #17110A; }

/* ----------------------------------------------------------------- faq -- */

.faq { border-top: 1px solid var(--rule); }
.faq details { border-bottom: 1px solid var(--rule); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 40px 20px 0; position: relative;
  font-family: "EB Garamond", Georgia, serif; font-size: 20px; font-weight: 600; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-family: "Public Sans", sans-serif; font-size: 22px; font-weight: 400; color: var(--accent-text);
}
.faq details[open] summary::after { content: "\2013"; }
.faq details > div { padding: 0 0 22px; color: var(--muted); font-size: 15.5px; max-width: var(--measure); }
.faq details > div p + p { margin-top: 12px; }

/* ---------------------------------------------------------------- form -- */

.form { display: flex; flex-direction: column; gap: 18px; max-width: 560px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink); }
.field .hint { font-size: 13px; color: var(--faint); }
.field input, .field textarea, .field select {
  font: inherit; font-size: 16px;
  padding: 12px 14px;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  width: 100%;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: 2px solid var(--brand-text); outline-offset: 1px; border-color: transparent;
}
.field textarea { min-height: 150px; resize: vertical; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.form-status {
  font-size: 15px; padding: 14px 16px; border-radius: var(--radius);
  border: 1px solid var(--rule); background: var(--raised); color: var(--ink);
}
.form-status[data-state="error"] { border-color: #C2553A; color: #A03D24; background: rgba(194, 85, 58, .08); }
.form-status[data-state="ok"] { border-color: #4A7C59; color: #2F5B3C; background: rgba(74, 124, 89, .09); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .form-status[data-state="error"] { color: #E89478; }
  :root:not([data-theme="light"]) .form-status[data-state="ok"] { color: #8FCBA0; }
}
:root[data-theme="dark"] .form-status[data-state="error"] { color: #E89478; }
:root[data-theme="dark"] .form-status[data-state="ok"] { color: #8FCBA0; }

/* --------------------------------------------------------- contact col -- */

.contact-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; gap: 40px; } }

.detail-list { display: flex; flex-direction: column; gap: 22px; margin: 0; }
.detail-list dt {
  font-size: 11.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--faint);
}
.detail-list dd { margin: 5px 0 0; font-size: 16.5px; color: var(--ink); line-height: 1.5; }
.detail-list dd a { text-decoration: none; }
.detail-list dd a:hover { text-decoration: underline; }

/* -------------------------------------------------------------- callout -- */

.callout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 24px 26px;
  display: flex; flex-direction: column; gap: 10px;
  max-width: var(--measure);
}
.callout h3 { font-size: 21px; }
.callout p { color: var(--muted); font-size: 15.5px; }

.note {
  font-size: 13.5px; color: var(--faint); max-width: var(--measure); line-height: 1.55;
}

/* ---------------------------------------------------------- logo mark --- */

.mark-base { fill: var(--brand); }
.mark-cut  { fill: var(--surface); }
.mark-acc  { fill: var(--accent); }

/* On the navy footer and navy bands the mark inverts. */
.footer .mark-base, .band--navy .mark-base { fill: #F7F4EC; }
.footer .mark-cut,  .band--navy .mark-cut  { fill: var(--brand-deep); }

/* The oversized decorative arch behind the hero is a single flat silhouette. */
.hero__arch .mark-base, .hero__arch .mark-acc { fill: currentColor; }
.hero__arch .mark-cut { fill: var(--paper); }

/* ------------------------------------------------------------- footer --- */

.footer { background: var(--brand-deep); color: rgba(247, 244, 236, .74); padding-block: 56px 40px; font-size: 15px; }
.footer a { color: rgba(247, 244, 236, .9); text-decoration: none; }
.footer a:hover { color: var(--accent); text-decoration: underline; }
.footer__grid {
  display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px;
  padding-bottom: 34px; border-bottom: 1px solid rgba(247, 244, 236, .16);
}
@media (max-width: 780px) { .footer__grid { grid-template-columns: 1fr 1fr; gap: 32px; } }
@media (max-width: 520px) { .footer__grid { grid-template-columns: 1fr; } }
.footer h4 {
  font-family: "Public Sans", sans-serif; font-size: 11.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.footer__brand { display: flex; flex-direction: column; gap: 14px; max-width: 34ch; }
.footer__brand .brand__name { color: var(--on-brand); }
.footer__brand p { color: rgba(247, 244, 236, .62); font-size: 14.5px; }
.footer__legal {
  padding-top: 24px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 13.5px; color: rgba(247, 244, 236, .55);
}
