/* Shared by every page: the seven colours, header, mobile menu, theme switch, footer, reveal. Loaded last. */
:root {
  --bg: #011130; --surface: #0A1C45; --ink: #EEF2F9; --muted: #A7B6CF; --accent: #7FD3F5; --brand: #4B9CD3; --green: #7EBF6A;
  --line: color-mix(in srgb, var(--ink) 10%, transparent);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #F5F3EE; --surface: #FFFFFF; --ink: #13294B; --muted: #5B6B86; --accent: #2F6FAF; --brand: #4B9CD3; --green: #4F9A3E;
  color-scheme: light;
}

/* header */
.nav { position: fixed; top: 0; left: 0; right: 0; z-index: 50; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 14px clamp(18px, 3.4vw, 48px);
  background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: blur(14px) saturate(1.2); -webkit-backdrop-filter: blur(14px) saturate(1.2); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; letter-spacing: .01em; color: var(--ink); }
.brand img { width: 34px; height: auto; }
.brand .logo-l { display: none; } :root[data-theme="light"] .brand .logo-l { display: block; } :root[data-theme="light"] .brand .logo-d { display: none; }
.nav-right { display: flex; align-items: center; gap: 22px; }
.menu { display: flex; gap: 26px; font-size: 14px; font-weight: 500; }
.menu a { color: var(--muted); text-decoration: none; position: relative; padding: 6px 0; transition: color .3s var(--ease); }
.menu a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); }
.menu a:hover { color: var(--ink); }
.menu a:hover::after, .menu a[aria-current="page"]::after { transform: scaleX(1); }
.menu a[aria-current="page"] { color: var(--ink); }
.theme-btn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--ink) 22%, transparent); background: transparent; color: var(--ink); display: grid; place-items: center; cursor: pointer; transition: background .3s var(--ease), transform .5s var(--ease); }
.theme-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); transform: rotate(-12deg); }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.theme-btn .sun { display: none; } :root[data-theme="light"] .theme-btn .sun { display: block; } :root[data-theme="light"] .theme-btn .moon { display: none; }
.menu-btn { display: none; width: 40px; height: 40px; border: 0; background: transparent; cursor: pointer; position: relative; }
.menu-btn span { position: absolute; left: 10px; right: 10px; height: 1.6px; background: var(--ink); transition: transform .45s var(--ease), top .45s var(--ease); }
.menu-btn span:first-child { top: 15px; } .menu-btn span:last-child { top: 23px; }
.menu-open .menu-btn span:first-child { top: 19px; transform: rotate(45deg); } .menu-open .menu-btn span:last-child { top: 19px; transform: rotate(-45deg); }

@media (max-width: 900px) {
  .menu-btn { display: block; }
  .menu { position: fixed; inset: 64px 0 auto 0; flex-direction: column; gap: 0; padding: 10px 18px 22px; background: var(--bg); border-bottom: 1px solid var(--line);
    opacity: 0; transform: translateY(-10px); pointer-events: none; transition: opacity .35s var(--ease), transform .45s var(--ease); }
  .menu a { font-size: 20px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .menu a::after { display: none; }
  .menu-open .menu { opacity: 1; transform: none; pointer-events: auto; }
  .nav-right { gap: 10px; }
}

/* footer */
.site-foot { position: relative; z-index: 2; border-top: 1px solid var(--line); padding: 40px clamp(18px, 3.4vw, 48px) 28px; color: var(--muted); font-size: 13.5px; background: var(--bg); }
.site-foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 24px; }
.site-foot-name { color: var(--ink); font-weight: 600; font-size: 15px; margin-bottom: 4px; }
.site-foot-links { display: flex; flex-wrap: wrap; gap: 20px; }
.site-foot-links a { color: var(--muted); text-decoration: none; transition: color .3s; }
.site-foot-links a:hover { color: var(--ink); }
.site-foot-copy { margin-top: 26px; font-size: 12.5px; opacity: .75; }

/* keyboard focus that matches the palette */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* page to page: a soft cross-fade with a small rise (browsers without support simply navigate) */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vtOut .32s cubic-bezier(0.4, 0, 1, 1) both; }
::view-transition-new(root) { animation: vtIn .55s cubic-bezier(0.22, 1, 0.36, 1) both; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; transform: translateY(14px); } }
/* the header stays put during page changes */
.nav { view-transition-name: site-nav; }
::view-transition-group(site-nav) { animation: none; }

/* theme switch: the new colours spread from the button */
html.theme-switching::view-transition-old(root), html.theme-switching::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* the header tucks away while reading down and returns on the way up */
.nav { transition: transform .5s var(--ease), background-color .6s var(--ease), border-color .6s var(--ease); }
html.nav-tucked:not(.menu-open) .nav { transform: translateY(-100%); }

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root), ::view-transition-new(root) { animation: none; }
  .nav { transition: none; }
}
