:root {
  --rapha-purple: #6d599f;
  --rapha-purple-deep: #594386;
  --ink: #202231;
  --muted: #667085;
  --line: #e5e7eb;
  --line-strong: #d8dbe3;
  --surface: #ffffff;
  --surface-soft: #fcfcfd;
  --focus: #594386;
  --shadow: 0 18px 50px rgba(31, 34, 48, 0.07);
  --max-width: 1180px;
  --serif: Georgia, "Times New Roman", Times, serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--surface-soft); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  background: var(--surface);
}

.site-header {
  min-height: 116px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.96);
}

.header-inner,
.footer-inner,
.main-inner {
  width: min(calc(100% - 72px), var(--max-width));
  margin-inline: auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.brand-link {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
}
.brand-link:focus-visible,
.text-link:focus-visible,
.primary-button:focus-visible,
.access-card:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

.brand-logo {
  display: block;
  width: 204px;
  height: auto;
}

.site-main { display: flex; }
.main-inner {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
}

.home-hero {
  width: min(100%, 930px);
  text-align: center;
  padding: 92px 0 100px;
}

.home-title {
  margin: 0 auto;
  max-width: 930px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(3rem, 5vw, 5.25rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.home-subtitle {
  margin: 32px auto 0;
  max-width: 660px;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.7;
}

.hero-actions {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.primary-button {
  min-width: 228px;
  min-height: 56px;
  padding: 15px 28px;
  border: 1px solid var(--rapha-purple);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--rapha-purple);
  color: #fff;
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  box-shadow: 0 10px 24px rgba(109, 89, 159, 0.18);
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.primary-button:hover {
  background: var(--rapha-purple-deep);
  border-color: var(--rapha-purple-deep);
  transform: translateY(-1px);
  box-shadow: 0 13px 28px rgba(109, 89, 159, 0.22);
}
.primary-button svg { width: 17px; height: 17px; }

.site-footer {
  min-height: 86px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  background: #fff;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}
.copyright {
  margin: 0;
  color: #667085;
  font-size: 0.82rem;
}
.footer-nav {
  display: flex;
  align-items: center;
  gap: 38px;
}
.text-link {
  min-height: 44px;
  padding: 10px 2px;
  display: inline-flex;
  align-items: center;
  color: var(--rapha-purple);
  font-size: 0.84rem;
  text-decoration: none;
  border-radius: 3px;
}
.text-link:hover { color: var(--rapha-purple-deep); text-decoration: underline; text-underline-offset: 4px; }

/* Secure access */
.access-main-inner {
  padding: 70px 0 78px;
  align-items: flex-start;
}
.access-panel {
  width: min(100%, 790px);
  text-align: center;
}
.page-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.6rem, 4vw, 4rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
}
.page-intro {
  margin: 18px auto 0;
  max-width: 620px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}
.access-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.access-card {
  min-height: 104px;
  padding: 24px 28px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  display: grid;
  grid-template-columns: 42px 1fr 24px;
  gap: 18px;
  align-items: center;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.access-card:hover {
  transform: translateY(-2px);
  border-color: #aaa0c7;
  box-shadow: 0 12px 28px rgba(31, 34, 48, 0.07);
  background: #fefeff;
}
.card-icon {
  width: 35px;
  height: 35px;
  color: var(--rapha-purple);
}
.card-label {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.card-arrow {
  width: 23px;
  height: 23px;
  color: var(--rapha-purple);
  justify-self: end;
}
.credentials-note {
  max-width: 600px;
  margin: 38px auto 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}

/* Website Privacy and Terms */
.utility-main-inner { padding: 72px 0 90px; align-items: flex-start; }
.utility-panel { width: min(100%, 760px); }
.utility-panel .page-title { text-align: left; }
.utility-copy {
  margin-top: 28px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}
.utility-copy p { margin: 0 0 1.2em; }
.utility-copy strong { color: var(--ink); }
.back-link { display: inline-flex; margin-top: 18px; }


.legal-meta {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.legal-copy h2 {
  margin: 2.05em 0 0.6em;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.3;
  font-weight: 400;
  letter-spacing: -0.012em;
}
.legal-copy h2:first-of-type { margin-top: 1.35em; }
.inline-link {
  color: var(--rapha-purple);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.inline-link:hover { text-decoration-thickness: 2px; }

@media (max-width: 760px) {
  .legal-meta { font-size: 0.84rem; }
  .legal-copy { font-size: 0.94rem; line-height: 1.72; }
  .legal-copy h2 { font-size: 1.32rem; }
}

@media (max-width: 760px) {
  .site-header { min-height: 90px; }
  .header-inner,
  .footer-inner,
  .main-inner { width: min(calc(100% - 38px), var(--max-width)); }
  .brand-logo { width: 154px; }
  .home-hero { padding: 78px 0 84px; }
  .home-title { font-size: clamp(2.42rem, 11vw, 3.35rem); line-height: 1.12; letter-spacing: -0.03em; }
  .home-subtitle { margin-top: 24px; font-size: 0.95rem; line-height: 1.65; }
  .hero-actions { margin-top: 34px; }
  .primary-button { width: 100%; min-width: 0; max-width: 310px; }
  .site-footer { min-height: 116px; padding: 22px 0; }
  .footer-inner { flex-direction: column; justify-content: center; gap: 18px; }
  .footer-nav { gap: 26px; }
  .copyright { order: 2; text-align: center; }
  .access-main-inner { padding: 52px 0 64px; }
  .page-title { font-size: 2.55rem; }
  .page-intro { margin-top: 15px; font-size: 0.94rem; }
  .access-grid { margin-top: 32px; grid-template-columns: 1fr; gap: 12px; }
  .access-card { min-height: 76px; padding: 18px 20px; grid-template-columns: 34px 1fr 22px; gap: 14px; }
  .card-icon { width: 30px; height: 30px; }
  .card-label { font-size: 1rem; }
  .credentials-note { margin-top: 30px; font-size: 0.88rem; }
  .utility-main-inner { padding: 54px 0 68px; }
  .utility-panel .page-title { font-size: 2.45rem; }
}

@media (max-width: 410px) {
  .header-inner,
  .footer-inner,
  .main-inner { width: calc(100% - 32px); }
  .footer-nav { width: 100%; justify-content: space-between; gap: 14px; }
  .text-link { font-size: 0.78rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

/* Program Support */
.support-main-inner {
  padding: 70px 0 82px;
  align-items: flex-start;
}
.support-panel {
  width: min(100%, 860px);
  text-align: center;
}
.support-grid {
  margin-top: 42px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.support-card {
  min-height: 300px;
  padding: 36px 34px 32px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: #fff;
  text-align: center;
}
.support-icon {
  width: 40px;
  height: 40px;
  color: var(--rapha-purple);
}
.support-card-title {
  margin: 22px 0 0;
  font-family: var(--serif);
  font-size: 1.72rem;
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.018em;
}
.support-card-copy {
  margin: 16px auto 0;
  max-width: 310px;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.68;
}
.secondary-button {
  min-width: 216px;
  min-height: 50px;
  margin-top: auto;
  padding: 13px 22px;
  border: 1px solid var(--rapha-purple);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--rapha-purple);
  background: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
.secondary-button:hover {
  color: #fff;
  background: var(--rapha-purple);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(109, 89, 159, 0.16);
}
.secondary-button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
.support-note {
  max-width: 680px;
  margin: 34px auto 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

@media (max-width: 760px) {
  .support-main-inner { padding: 52px 0 66px; }
  .support-grid { margin-top: 32px; grid-template-columns: 1fr; gap: 14px; }
  .support-card { min-height: 250px; padding: 30px 24px 26px; }
  .support-icon { width: 35px; height: 35px; }
  .support-card-title { margin-top: 18px; font-size: 1.55rem; }
  .support-card-copy { margin-top: 13px; font-size: 0.91rem; }
  .secondary-button { width: 100%; min-width: 0; max-width: 310px; margin-top: 24px; }
  .support-note { margin-top: 28px; font-size: 0.82rem; }
}

/* Mobile production optimization — v8
   Interactive public pages fit within a standard 390 × 844 viewport without page scroll.
   Legal pages retain a single-column, full-width reading layout with normal vertical scroll. */
@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .site-header {
    min-height: 76px;
  }
  .header-inner,
  .footer-inner,
  .main-inner {
    width: calc(100% - 32px);
  }
  .brand-logo {
    width: 145px;
  }

  .site-footer {
    min-height: 88px;
    padding: 11px 0 10px;
  }
  .footer-inner {
    gap: 10px;
  }
  .footer-nav {
    width: 100%;
    justify-content: center;
    gap: 23px;
  }
  .text-link {
    min-height: 44px;
    padding: 10px 1px;
    font-size: 0.78rem;
    white-space: nowrap;
  }
  .copyright {
    font-size: 0.74rem;
    line-height: 1.3;
  }

  /* One-screen interactive pages at normal mobile sizes, with safe scroll fallback. */
  .interactive-page {
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .interactive-page .site-shell {
    min-height: 100vh;
    min-height: 100dvh;
  }
  .interactive-page .site-header {
    min-height: 76px;
  }
  .interactive-page .site-main,
  .interactive-page .main-inner {
    min-height: 0;
  }
  .interactive-page .site-footer {
    min-height: 88px;
  }

  /* Homepage */
  .home-page .home-hero {
    padding: 20px 0 22px;
  }
  .home-page .home-title {
    max-width: 355px;
    font-size: clamp(2.22rem, 10vw, 2.72rem);
    line-height: 1.09;
    letter-spacing: -0.032em;
  }
  .home-page .home-subtitle {
    max-width: 320px;
    margin-top: 18px;
    font-size: 0.9rem;
    line-height: 1.48;
  }
  .home-page .hero-actions {
    margin-top: 24px;
  }
  .home-page .primary-button {
    min-height: 50px;
    max-width: 292px;
    padding: 12px 22px;
  }

  /* Secure Access */
  .access-page .access-main-inner {
    padding: 18px 0 20px;
    align-items: center;
  }
  .access-page .page-title {
    font-size: 2.18rem;
  }
  .access-page .page-intro {
    max-width: 330px;
    margin-top: 9px;
    font-size: 0.88rem;
    line-height: 1.45;
  }
  .access-page .access-grid {
    margin-top: 20px;
    gap: 9px;
  }
  .access-page .access-card {
    min-height: 60px;
    padding: 12px 16px;
    grid-template-columns: 30px 1fr 20px;
    gap: 12px;
    border-radius: 6px;
  }
  .access-page .card-icon {
    width: 27px;
    height: 27px;
  }
  .access-page .card-label {
    font-size: 0.96rem;
  }
  .access-page .card-arrow {
    width: 20px;
    height: 20px;
  }
  .access-page .credentials-note {
    max-width: 334px;
    margin-top: 17px;
    font-size: 0.8rem;
    line-height: 1.42;
  }

  /* Program Support */
  .support-page .support-main-inner {
    padding: 14px 0 16px;
    align-items: center;
  }
  .support-page .page-title {
    font-size: 2.08rem;
  }
  .support-page .page-intro {
    max-width: 335px;
    margin-top: 8px;
    font-size: 0.84rem;
    line-height: 1.42;
  }
  .support-page .support-grid {
    margin-top: 17px;
    gap: 10px;
  }
  .support-page .support-card {
    min-height: 0;
    padding: 13px 15px 14px;
    display: grid;
    grid-template-columns: 31px minmax(0, 1fr);
    grid-template-areas:
      "icon title"
      "copy copy"
      "button button";
    column-gap: 10px;
    align-items: center;
    text-align: left;
    border-radius: 7px;
  }
  .support-page .support-icon {
    grid-area: icon;
    width: 28px;
    height: 28px;
  }
  .support-page .support-card-title {
    grid-area: title;
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.15;
  }
  .support-page .support-card-copy {
    grid-area: copy;
    max-width: none;
    margin: 8px 0 0;
    font-size: 0.81rem;
    line-height: 1.38;
    text-align: left;
  }
  .support-page .secondary-button {
    grid-area: button;
    width: 100%;
    max-width: none;
    min-height: 48px;
    margin-top: 11px;
    padding: 9px 14px;
    font-size: 0.84rem;
  }
  .support-page .support-note {
    max-width: 340px;
    margin-top: 14px;
    font-size: 0.76rem;
    line-height: 1.36;
  }

  /* Privacy and Terms: one screen wide, normal continuous vertical scroll */
  .legal-page {
    overflow-x: hidden;
    overflow-y: auto;
  }
  .legal-page .site-shell {
    min-height: 100vh;
    min-height: 100dvh;
    overflow: visible;
  }
  .legal-page .utility-main-inner {
    width: calc(100% - 32px);
    padding: 28px 0 44px;
    align-items: flex-start;
  }
  .legal-page .utility-panel {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }
  .legal-page .utility-panel .page-title {
    max-width: 100%;
    font-size: 2.08rem;
    line-height: 1.12;
    overflow-wrap: anywhere;
  }
  .legal-page .legal-meta {
    margin-top: 9px;
    font-size: 0.8rem;
  }
  .legal-page .utility-copy {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin-top: 19px;
    padding-top: 19px;
    font-size: 0.92rem;
    line-height: 1.68;
    overflow-wrap: anywhere;
    word-break: normal;
    hyphens: auto;
  }
  .legal-page .utility-copy p,
  .legal-page .utility-copy h2,
  .legal-page .utility-copy a,
  .legal-page .utility-copy strong {
    max-width: 100%;
    overflow-wrap: anywhere;
  }
  .legal-page .utility-copy p {
    margin-bottom: 1.08em;
  }
  .legal-page .legal-copy h2 {
    margin: 1.65em 0 0.5em;
    font-size: 1.24rem;
    line-height: 1.28;
  }
  .legal-page .legal-copy h2:first-of-type {
    margin-top: 1.15em;
  }
  .legal-page .back-link {
    margin-top: 12px;
  }
}

@media (max-width: 370px) {
  .header-inner,
  .footer-inner,
  .main-inner,
  .legal-page .utility-main-inner {
    width: calc(100% - 26px);
  }
  .footer-nav {
    gap: 15px;
  }
  .home-page .home-title {
    font-size: 2.1rem;
  }
  .support-page .support-card-copy {
    font-size: 0.78rem;
  }
}

/* Preserve the intended page gutters inside the flex-based main region. */
.site-main .main-inner {
  flex: 0 1 auto;
}


/* Production hardening — v8 */
.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 10px;
  padding: 10px 14px;
  border-radius: 4px;
  background: var(--ink);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  transform: translateY(-160%);
}
.skip-link:focus {
  transform: translateY(0);
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}
[aria-current="page"] {
  color: var(--rapha-purple-deep);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.error-panel {
  width: min(100%, 660px);
  padding: 64px 0 72px;
  text-align: center;
}
.error-code {
  margin: 0 0 12px;
  color: var(--rapha-purple);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.error-actions {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.error-actions .secondary-button { margin-top: 0; }
@media (max-width: 760px) {
  .error-panel { padding: 28px 0 34px; }
  .error-actions { margin-top: 24px; flex-direction: column; align-items: center; }
  .error-actions .primary-button, .error-actions .secondary-button { width: 100%; max-width: 292px; min-height: 48px; }
}
@media (max-width: 760px) and (max-height: 700px) {
  .interactive-page .site-header { min-height: 68px; }
  .interactive-page .brand-logo { width: 132px; }
  .interactive-page .site-footer { min-height: 82px; padding-block: 7px; }
  .home-page .home-hero { padding-block: 14px; }
  .access-page .access-main-inner, .support-page .support-main-inner { padding-block: 12px; }
}
@media (orientation: landscape) and (max-width: 900px) {
  .interactive-page { overflow-y: auto; }
  .interactive-page .site-shell { min-height: 100%; }
}
@media (forced-colors: active) {
  .primary-button, .secondary-button, .access-card, .support-card { border: 1px solid ButtonText; }
  .brand-link:focus-visible, .text-link:focus-visible, .primary-button:focus-visible, .secondary-button:focus-visible, .access-card:focus-visible { outline: 3px solid Highlight; }
}

/* Compact standard-laptop height without changing the approved large-screen composition. */
@media (min-width: 761px) and (max-height: 850px) {
  .site-header { min-height: 100px; }
  .site-footer { min-height: 76px; }
  .access-main-inner { padding: 46px 0 48px; }
  .access-grid { margin-top: 32px; }
  .access-card { min-height: 94px; padding-block: 20px; }
  .credentials-note { margin-top: 28px; }
  .support-main-inner { padding: 42px 0 46px; }
  .support-grid { margin-top: 32px; }
  .support-card { min-height: 266px; padding: 30px 30px 28px; }
  .support-card-title { margin-top: 18px; }
  .support-card-copy { margin-top: 13px; }
  .support-note { margin-top: 25px; }
}
