:root {
  color-scheme: light dark;
  /* From the Marge desktop functional theme. */
  --background: #F3F7FC;
  --surface: #FFFFFF;
  --sidebar: #E8F0F8;
  --text: #162B40;
  --muted: #435A6F;
  --border: #CBD8E5;
  --selected: #D5E7F7;
  --personal: #2474C7;
  --household: #27834A;
  --organisation: #7945AF;
  --accent: var(--personal);
  --accent-text: #205F9F;
  --content: 72rem;
}
@media (prefers-color-scheme: dark) {
  :root {
    --background: #101A26;
    --surface: #182635;
    --sidebar: #112231;
    --text: #F3F7FC;
    --muted: #C0CAD6;
    --border: #385064;
    --selected: #29455C;
    --accent-text: #91C6FF;
  }
}
* { box-sizing: border-box; }
html { background: var(--background); scroll-behavior: smooth; }
body { background: var(--background); color: var(--text); margin: 0; font: 1rem/1.55 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
a { color: inherit; }
a:hover { color: var(--accent-text); }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 4px; }
button { font: inherit; }
.site-shell { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; background: var(--background); }
.content-width { width: min(calc(100% - 4rem), var(--content)); margin-inline: auto; }
.skip-link { position: fixed; left: 1rem; top: -5rem; background: var(--surface); border: 1px solid var(--accent-text); padding: .55rem 1rem; z-index: 40; }
.skip-link:focus { top: .75rem; }
.site-header { border-bottom: 2px solid var(--accent); background: var(--surface); }
.header-inner { min-height: 5.5rem; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.brand { display: inline-flex; align-items: center; gap: .9rem; text-decoration: none; }
.brand-logo { width: 3.6rem; height: 3.6rem; object-fit: contain; flex: none; }
.brand-name { font-size: 1.3rem; letter-spacing: -.04em; font-weight: 650; white-space: nowrap; }
.brand-name span { color: var(--accent-text); }
.header-caption { font-size: .7rem; font-weight: 650; letter-spacing: .18em; color: var(--muted); text-align: right; }
.site-navigation { border-bottom: 1px solid var(--border); background: var(--sidebar); }
.nav-links { display: flex; list-style: none; padding: 0; margin: 0; gap: 2rem; }
.nav-links a { display: block; padding: .9rem .1rem; color: var(--muted); text-decoration: none; font-size: .92rem; border-bottom: 2px solid transparent; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); border-color: var(--accent-text); }
.mobile-menu { display: none; }
.site-main { flex: 1 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 2rem; padding: clamp(2rem, 5vw, 4rem); margin-block: 2rem; background: var(--sidebar); border: 1px solid var(--border); border-radius: 13px; }
.eyebrow { color: var(--accent-text); font-size: .73rem; font-weight: 700; letter-spacing: .18em; margin: 0 0 1.4rem; }
.eyebrow-line { display: inline-block; height: 1px; width: 1.5rem; margin: 0 .55rem .24rem 0; background: var(--accent-text); }
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2, h3 { line-height: 1.12; letter-spacing: -.02em; }
h1 { font-size: clamp(2rem, 4vw, 3rem); margin: 0 0 1.4rem; font-weight: 680; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.3rem); margin: 0; }
h3 { font-size: 1.6rem; margin: .6rem 0 1rem; }
.accent { color: var(--accent-text); }
.lead { font-size: clamp(1.12rem, 2vw, 1.35rem); line-height: 1.6; margin: 0 0 1rem; max-width: 36rem; }
.supporting-copy { color: var(--muted); margin: 0; max-width: 36rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; margin-top: 2.2rem; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 1rem; min-height: 2.85rem; padding: .7rem 1.3rem; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; font-size: .9rem; font-weight: 650; line-height: 1.4; cursor: pointer; }
.button-primary { background: #205F9F; color: #fff; border-color: #205F9F; }
.button-primary:hover { background: #184D83; border-color: #184D83; color: #fff; }
.button-secondary { background: var(--surface); }
.button-secondary:hover { border-color: var(--accent-text); }
.button:disabled { background: var(--selected); border-color: var(--border); color: var(--muted); cursor: not-allowed; }
.hero-mark { display: flex; justify-content: center; align-items: center; }
.hero-mark img { display: block; width: min(100%, 23rem); height: auto; }
.projects-section { padding: 2.5rem 0 6rem; border-top: 1px solid var(--border); scroll-margin-top: 1rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 2rem; margin-bottom: 2rem; }
.section-heading .eyebrow { margin-bottom: .65rem; }
.section-heading > p { color: var(--muted); font-size: .88rem; margin: 0 0 .1rem; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.project-card { min-width: 0; background: var(--surface); padding: 2rem; border: 1px solid var(--border); }
.project-card p:not(.project-index) { color: var(--muted); margin: 0 0 1.8rem; }
.project-index, .panel-kicker { font-size: .71rem; color: var(--accent-text); font-weight: 700; letter-spacing: .15em; }
.project-status { font-size: .75rem; color: var(--muted); display: inline-block; border: 1px solid var(--border); padding: .25rem .7rem; border-radius: 2rem; }
.narrow-page { max-width: 39rem; padding: clamp(2rem, 5vw, 4rem) 0 4rem; }
.narrow-page h1 { font-size: clamp(1.75rem, 3vw, 2.5rem); }
.narrow-page > .lead { color: var(--muted); }
.outlined-panel { border: 1px solid var(--border); border-radius: 10px; background: var(--surface); margin-top: 1.5rem; padding: 1.5rem; }
.outlined-panel h2 { font-size: 1.55rem; margin: 0 0 1rem; }
.outlined-panel p { color: var(--muted); }
.outlined-panel .panel-kicker { color: var(--accent-text); margin: 0 0 .8rem; }
.outlined-panel .button { margin-top: 1rem; }
.small-note { font-size: .82rem; }
.back-link { margin-top: 2rem; font-size: .9rem; }
.back-link a { color: var(--accent-text); text-decoration: none; }
.site-footer { border-top: 1px solid var(--border); background: var(--surface); }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 1.5rem; color: var(--muted); font-size: .78rem; }
.footer-inner span:first-child { color: var(--text); font-weight: 700; letter-spacing: .14em; }
@media (max-width: 760px) {
  .site-chrome { position: sticky; top: 0; z-index: 20; }
  .site-main { scroll-margin-top: 8.5rem; }
  .projects-section { scroll-margin-top: 8.5rem; }
  .content-width { width: min(calc(100% - 2.5rem), var(--content)); }
  .header-inner { min-height: 4.5rem; }
  .brand-logo { width: 2.9rem; height: 2.9rem; }
  .brand-name { font-size: 1.12rem; }
  .header-caption { display: none; }
  .desktop-links { display: none; }
  .mobile-menu { display: block; width: 100%; }
  .mobile-menu summary { display: flex; justify-content: space-between; align-items: center; min-height: 3rem; cursor: pointer; font-size: .93rem; list-style: none; }
  .mobile-menu summary::-webkit-details-marker { display: none; }
  .menu-glyph { color: var(--accent-text); font-size: 1.3rem; line-height: 1; }
  .mobile-links { flex-direction: column; gap: 0; border-top: 1px solid var(--border); padding: .3rem 0; }
  .mobile-links a { padding: .65rem .2rem; }
  .hero { grid-template-columns: 1fr; gap: 1rem; padding: 1.5rem; min-height: 0; }
  .hero-mark { grid-row: 1; justify-content: flex-start; }
  .hero-mark img { width: 8.5rem; }
  .hero-copy { grid-row: 1; }
  .hero h1 { font-size: clamp(2rem, 7vw, 3rem); }
  .projects-section { padding-bottom: 4rem; }
  .project-grid { grid-template-columns: 1fr; }
  .project-card { padding: 1.5rem; }
  .narrow-page { padding: 3.5rem 0 5rem; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: .35rem; }
}
@media (max-width: 380px) {
  .content-width { width: calc(100% - 2rem); }
  .brand-name { font-size: 1rem; }
  .section-heading { flex-direction: column; align-items: start; gap: .35rem; }
  .outlined-panel { padding: 1.4rem; }
  .hero-actions .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Match sign-out forms to navigation links without inline scripts. */
.nav-links form { margin: 0; }
.nav-links .nav-button {
  display: block;
  padding: .9rem .1rem;
  color: var(--muted);
  border: 0;
  border-bottom: 2px solid transparent;
  background: var(--surface);
  font-size: .92rem;
  line-height: inherit;
  cursor: pointer;
}
.nav-links .nav-button:hover,
.nav-links .nav-button:focus-visible { color: var(--accent-text); border-color: var(--accent-text); }
@media (max-width: 760px) {
  .nav-links .nav-button { padding: .65rem .2rem; width: 100%; text-align: left; }
}

/* Language selector: compact on desktop and mobile. */
.language-switch { margin-left: auto; white-space: nowrap; font-size: .8rem; letter-spacing: .08em; }
.language-switch a { color: var(--muted); text-decoration: none; padding: .35rem; }
.language-switch a[aria-current="true"] { color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: .25em; }
.language-switch a:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }

/* Account disclosure: native keyboard/touch interaction, no script required. */
.site-header { position: relative; z-index: 2; }
.header-inner { gap: 1rem; }
.account-menu { position: relative; flex: none; }
.account-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; flex: none; color: var(--muted); border: 1px solid var(--border); border-radius: 50%; text-decoration: none; cursor: pointer; list-style: none; }
.account-icon::-webkit-details-marker { display: none; }
.account-icon::marker { content: ""; }
.account-icon:hover, .account-icon-active, .account-menu[open] > summary { color: var(--accent-text); border-color: var(--accent-text); }
.account-dropdown { position: absolute; right: 0; top: calc(100% + .5rem); min-width: 10rem; padding: .35rem; border: 1px solid var(--border); border-radius: .25rem; background: var(--surface); box-shadow: 0 .5rem 1.5rem #162b4033; }
.account-dropdown form { margin: 0; }
.account-dropdown a, .account-dropdown button { display: block; width: 100%; padding: .65rem .8rem; color: var(--text); background: transparent; border: 0; border-radius: .2rem; text-decoration: none; text-align: left; font-size: .92rem; cursor: pointer; white-space: nowrap; }
.account-dropdown a:hover, .account-dropdown button:hover { background: var(--selected); color: var(--accent-text); }
@media (max-width: 760px) {
  .header-inner { gap: .5rem; }
  .brand { gap: .4rem; }
  .language-switch a { padding: .15rem; }
}
@media (max-width: 380px) {
  .brand-logo { width: 2.35rem; height: 2.35rem; }
  .brand-name { font-size: .95rem; }
  .account-icon { width: 2.5rem; height: 2.5rem; }
}
