/* Public site header and footer, shared by the front page and every public page. */
.site-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: var(--space-5); min-height: 64px; padding: 10px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--color-border); background: color-mix(in srgb, var(--color-surface) 92%, transparent); backdrop-filter: saturate(1.4) blur(10px); }
.site-header .flowstate-wordmark { color: var(--color-text); font-size: 1.125rem; text-decoration: none; }
.site-header__nav { display: flex; flex: 1 1 auto; gap: var(--space-5); min-width: 0; margin-left: var(--space-4); overflow: hidden; }
.site-header__nav a[hidden] { display: none; }
.site-header__nav a, .site-header__signin { color: var(--color-text-muted); font-size: 0.875rem; font-weight: 550; text-decoration: none; white-space: nowrap; }
.site-header__nav a:hover, .site-header__signin:hover, .site-header__nav a[aria-current] { color: var(--color-text); }
.site-header__actions { display: flex; align-items: center; gap: var(--space-4); margin-left: auto; }
.site-header__theme { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--color-text-muted); cursor: pointer; }
.site-header__theme svg { width: 20px; height: 20px; }
.site-header__theme:hover { background: var(--accent-soft); color: var(--color-text); }
.site-header__cta { padding: 8px 14px; border-radius: var(--radius-md); background: var(--accent-strong); color: var(--accent-contrast); font-size: 0.875rem; font-weight: 650; text-decoration: none; box-shadow: var(--shadow-sm); white-space: nowrap; }
.site-header__cta:hover { box-shadow: var(--shadow-md); }
/* Trying without an account: the one accent link in the main menu. */
.site-header__nav .site-header__try, .site-drawer__links .site-header__try { color: var(--accent-strong); font-weight: 650; }
.site-header__nav .site-header__try:hover, .site-drawer__links .site-header__try:hover { color: var(--color-text); }
/* Language switch: EN and SV side by side; the chosen one is filled. */
.site-lang { display: inline-flex; padding: 2px; border: 1px solid var(--color-border); border-radius: 999px; }
.site-lang a { padding: 4px 9px; border-radius: 999px; color: var(--color-text); font-size: 0.75rem; font-weight: 650; letter-spacing: 0.04em; text-decoration: none; }
.site-lang a:hover { color: var(--accent-strong); }
.site-lang a[aria-current="true"] { background: var(--accent-strong); color: var(--accent-contrast); }
.site-lang a:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.site-header a:focus-visible, .site-header__theme:focus-visible, .site-footer a:focus-visible, .site-footer button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 3px; border-radius: 6px; }

.site-footer { margin-top: auto; padding: clamp(32px, 5vw, 56px) clamp(16px, 4vw, 48px) var(--space-5); border-top: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-text-muted); }
.site-footer__inner { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--space-6); }
.site-footer__brand .flowstate-wordmark { color: var(--color-text); font-size: 1.125rem; text-decoration: none; }
.site-footer__brand p { margin: var(--space-2) 0 0; font-size: 0.875rem; }
.site-footer__col { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-2); }
.site-footer__col h2 { margin: 0 0 var(--space-1); color: var(--color-text); font-size: 0.8125rem; font-weight: 650; }
.site-footer__col a, .site-footer__col button { padding: 0; border: 0; background: none; color: var(--color-text-muted); font: inherit; font-size: 0.875rem; text-decoration: none; cursor: pointer; }
/* Footer links: a thin line flows in under the text from the left, like a connection on a Board, in the accent. */
.site-footer__col :is(a, button) { background: linear-gradient(currentColor, currentColor) left bottom / 0 1px no-repeat; background-origin: content-box; transition: color 0.2s ease, background-size 0.3s cubic-bezier(0.2, 0.7, 0.3, 1), translate 0.2s ease; }
.site-footer__col :is(a, button):is(:hover, :focus-visible) { color: var(--accent-strong); background-size: 100% 1px; translate: 0.125rem 0; }
.site-footer__brand .flowstate-wordmark { display: inline-block; transition: color 0.2s ease, translate 0.3s cubic-bezier(0.2, 0.7, 0.3, 1); }
.site-footer__brand .flowstate-wordmark:hover { color: var(--accent-strong); translate: 0 -0.125rem; }
@media (prefers-reduced-motion: reduce) {
	.site-footer__col :is(a, button), .site-footer__brand .flowstate-wordmark { transition: none; }
	.site-footer__col :is(a, button):is(:hover, :focus-visible), .site-footer__brand .flowstate-wordmark:hover { translate: none; }
}
.site-footer__legal { margin: var(--space-6) 0 0; padding-top: var(--space-4); border-top: 1px solid var(--color-border); font-size: 0.8125rem; }

@media (max-width: 720px) {
	.site-footer__inner { grid-template-columns: 1fr 1fr; }
	.site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
	.site-header__actions { gap: var(--space-2); }
}

/* Motion: smooth anchor scrolling, the header sliding away and content fading in. */
html { scroll-padding-top: 80px; }
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
	.site-header { transition: transform 300ms ease-out, box-shadow 300ms ease-out; }
	.site-header.is-hidden { transition-timing-function: ease-in; }
	.reveal { opacity: 0; transform: translateY(28px); transition: opacity 600ms var(--ease-standard), transform 600ms cubic-bezier(0.2, 0.7, 0.2, 1); transition-delay: var(--reveal-delay, 0ms); }
	.reveal.is-revealed { opacity: 1; transform: none; }
}
.site-header.is-hidden { transform: translateY(-100%); }
body.has-scrolled .site-header:not(.is-hidden) { box-shadow: var(--shadow-sm); }

/*
 * Navy tone for content bands and the footer, in dark mode only.
 * Light mode keeps the normal light page.
 */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .tone-navy { --color-bg: #172331; --color-surface: #1e2c3d; --color-surface-raised: #243549; --color-border: #2c3e54; --color-border-strong: #3a5070; --color-text: #f1f4f8; --color-text-muted: #aebbc9; --color-text-faint: #8c9eb3; --accent: #ff6b8e; --accent-strong: #ff8aa7; --accent-soft: #46263a; --accent-contrast: #14161c; --color-success: #5fd39a; --color-warning: #f0b45a; --shadow-sm: 0 1px 2px rgba(6, 12, 20, 0.35); --shadow-md: 0 6px 20px rgba(6, 12, 20, 0.35); --shadow-lg: 0 18px 48px rgba(6, 12, 20, 0.45); background: var(--color-bg); color: var(--color-text); color-scheme: dark; }
}
:root[data-theme="dark"] .tone-navy { --color-bg: #172331; --color-surface: #1e2c3d; --color-surface-raised: #243549; --color-border: #2c3e54; --color-border-strong: #3a5070; --color-text: #f1f4f8; --color-text-muted: #aebbc9; --color-text-faint: #8c9eb3; --accent: #ff6b8e; --accent-strong: #ff8aa7; --accent-soft: #46263a; --accent-contrast: #14161c; --color-success: #5fd39a; --color-warning: #f0b45a; --shadow-sm: 0 1px 2px rgba(6, 12, 20, 0.35); --shadow-md: 0 6px 20px rgba(6, 12, 20, 0.35); --shadow-lg: 0 18px 48px rgba(6, 12, 20, 0.45); background: var(--color-bg); color: var(--color-text); color-scheme: dark; }
.site-footer.tone-navy { color: var(--color-text-muted); }

/*
 * Dark mode on the public site is the same navy family instead of near black:
 * the page is #234 navy and navy bands sit a step deeper, so sections still read.
 */
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) body.site-public { --color-bg: #223344; --color-surface: #283b4f; --color-surface-raised: #2e4359; --color-border: #3a4f67; --color-border-strong: #4b6382; --color-text: #f1f4f8; --color-text-muted: #b6c3d1; --color-text-faint: #a1afc0; --accent: #ff6b8e; --accent-strong: #ff8aa7; --accent-soft: #46263a; --accent-contrast: #14161c; background: var(--color-bg); color: var(--color-text); }
	:root:not([data-theme="light"]):has(body.site-public) { background: #223344; }
}
:root[data-theme="dark"] body.site-public { --color-bg: #223344; --color-surface: #283b4f; --color-surface-raised: #2e4359; --color-border: #3a4f67; --color-border-strong: #4b6382; --color-text: #f1f4f8; --color-text-muted: #b6c3d1; --color-text-faint: #a1afc0; --accent: #ff6b8e; --accent-strong: #ff8aa7; --accent-soft: #46263a; --accent-contrast: #14161c; background: var(--color-bg); color: var(--color-text); }
:root[data-theme="dark"]:has(body.site-public) { background: #223344; }

/* Menu button and the side panel for links that do not fit. */
.site-header__menu { display: grid; width: 40px; height: 40px; place-items: center; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: var(--color-surface); color: var(--color-text); cursor: pointer; }
.site-header__menu[hidden] { display: none; }
.site-header__menu svg { width: 22px; height: 22px; }
.site-header__menu:focus-visible, .site-drawer a:focus-visible, .site-drawer button:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 2px; }
.site-drawer-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(10, 16, 24, 0.45); opacity: 0; transition: opacity 300ms ease; }
.site-drawer-backdrop.is-open { opacity: 1; }
.site-drawer-backdrop[hidden], .site-drawer[hidden] { display: none; }
.site-drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 61; display: flex; flex-direction: column; gap: var(--space-5); width: min(340px, 86vw); padding: var(--space-4) var(--space-5) var(--space-6); overflow-y: auto; background: var(--color-surface); color: var(--color-text); box-shadow: -18px 0 48px rgba(10, 16, 24, 0.25); transform: translateX(100%); transition: transform 300ms ease-in; }
.site-drawer.is-open { transform: none; transition-timing-function: ease-out; }
.site-drawer__head { display: flex; align-items: center; justify-content: space-between; }
.site-drawer__head .flowstate-wordmark { color: var(--color-text); font-size: 1.125rem; text-decoration: none; }
.site-drawer__close { display: grid; width: 40px; height: 40px; place-items: center; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--color-text-muted); cursor: pointer; }
.site-drawer__close svg { width: 22px; height: 22px; }
.site-drawer__close:hover { background: var(--accent-soft); color: var(--color-text); }
.site-drawer__links { display: flex; flex-direction: column; }
.site-drawer__links[hidden], .site-drawer__links a[hidden] { display: none; }
.site-drawer__links a { padding: 14px 4px; border-bottom: 1px solid var(--color-border); color: var(--color-text); font-size: 1.0625rem; font-weight: 600; text-decoration: none; }
.site-drawer__links a[aria-current] { color: var(--accent-strong); }
/* The account block draws its own line above; the last link needs none of its own. */
.site-drawer__links a:last-child { border-bottom: 0; }
.site-drawer__links a:hover { color: var(--accent-strong); }
.site-drawer__account { display: grid; gap: var(--space-2); margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--color-border); }
.site-drawer__account .site-header__cta { padding: 12px 16px; text-align: center; }
.site-drawer__signin { padding: 12px 16px; border: 1px solid var(--color-border); border-radius: var(--radius-md); color: var(--color-text); font-weight: 600; text-align: center; text-decoration: none; }
.site-drawer__theme { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: 0; background: none; color: var(--color-text-muted); font: inherit; cursor: pointer; }
.site-drawer__theme svg { width: 18px; height: 18px; }
body.has-drawer { overflow: hidden; }
@media (max-width: 640px) {
	.site-header { gap: var(--space-3); }
	.site-header__nav { display: none; }
	.site-header__signin { display: none; }
}
/* The side panel's language switch shows only when the header has no room for its own. */
.site-drawer__lang { display: none; justify-self: center; }
@media (max-width: 339.98px) {
	.site-header__actions > .site-lang { display: none; }
	.site-drawer__lang { display: inline-flex; }
}
@media (max-width: 400px) {
	.site-header__theme { display: none; }
	/* "Create account", the language switch and the menu fit a 360-pixel phone without a sideways scroll. */
	.site-header__cta { padding: 8px 10px; font-size: 0.8125rem; }
	.site-lang a { padding: 4px 7px; }
}
@media (prefers-reduced-motion: reduce) {
	.site-drawer, .site-drawer-backdrop { transition: none; }
}
/* Features and its use-case pages: a small menu under the header item. */
.site-header__nav [hidden] { display: none; }
.site-header__group { display: inline-flex; align-items: center; gap: 2px; }
.site-header__group.is-current > a { color: var(--color-text); }
.site-header__more { display: grid; width: 22px; height: 22px; place-items: center; margin-right: -6px; padding: 0; border: 0; border-radius: 6px; background: none; color: var(--color-text-muted); cursor: pointer; }
.site-header__more svg { width: 15px; height: 15px; transition: transform 180ms ease; }
.site-header__more[aria-expanded="true"] svg { transform: rotate(180deg); }
.site-header__more:hover, .site-header__group:hover .site-header__more { color: var(--color-text); }
.site-header__more:focus-visible { outline: 2px solid var(--accent-strong); outline-offset: 1px; }
.site-submenu { position: absolute; top: calc(100% - 6px); z-index: 2; display: grid; width: 300px; padding: 8px; border-radius: 16px; background: var(--color-surface); box-shadow: 0 18px 48px rgb(15 23 42 / 0.16), 0 2px 6px rgb(15 23 42 / 0.06); opacity: 0; transform: translateY(-4px); transition: opacity 140ms ease, transform 160ms ease; }
.site-submenu::before { content: ""; position: absolute; inset: -14px 0 auto; height: 14px; }
.site-submenu[hidden] { display: none; }
.site-submenu.is-open { opacity: 1; transform: none; }
.site-submenu a { display: grid; gap: 2px; padding: 10px 12px; border-radius: 10px; color: var(--color-text); text-decoration: none; }
.site-submenu a strong { font-size: 0.9375rem; font-weight: 650; }
.site-submenu a span { color: var(--color-text-muted); font-size: 0.8125rem; }
.site-submenu a:hover, .site-submenu a:focus-visible { background: color-mix(in srgb, var(--color-text) 5%, transparent); outline: none; }
.site-submenu a:hover strong, .site-submenu a[aria-current="page"] strong { color: var(--accent-strong); }
.site-submenu a.site-submenu__all { margin-top: 4px; padding-top: 12px; border-top: 1px solid var(--color-border); border-radius: 0 0 10px 10px; color: var(--accent-strong); font-size: 0.875rem; font-weight: 650; }
.site-drawer__links a.site-drawer__sublink { padding-left: 20px; color: var(--color-text-muted); font-size: 0.9375rem; font-weight: 550; }
.site-drawer__links a.site-drawer__sublink[aria-current="page"] { color: var(--accent-strong); }
[data-theme="dark"] .site-submenu { background: var(--color-surface-raised, var(--color-surface)); box-shadow: 0 18px 48px rgb(0 0 0 / 0.45); }
@media (prefers-reduced-motion: reduce) {
	.site-submenu, .site-header__more svg { transition: none; }
}
/* Main menu links use the text color (#14161c in Light); hover and the current page take the accent. */
.site-header__nav a, .site-header__more { color: var(--color-text); }
.site-header__nav a:hover, .site-header__nav a[aria-current], .site-header__group.is-current > a, .site-header__more:hover, .site-header__group:hover .site-header__more { color: var(--accent-strong); }
/* Sign in and the theme button match the main menu: text color, accent on hover. */
.site-header__signin, .site-header__theme { color: var(--color-text); }
.site-header__signin:hover, .site-header__theme:hover { color: var(--accent-strong); }
