project-bifrost-platform/src/layouts/AppLayout.astro
Jonathan Hvid 73dc656257 style(nav): active link is colour + weight only — drop bullet, italic, case swap
.nav-link.active was carrying four overlapping cues from earlier passes:
terracotta colour, serif italic, sentence case, leading '·' bullet, and
a 15px size bump. The spec's 'option 4' is colour-only. Strip the rest:

  .nav-link.active {
    color: var(--pigment-terracotta);
    font-weight: 500;
  }

That's it. Same sans uppercase as inactive links, just terracotta with
a touch more weight. The bullet ::before is gone; nothing floats below
the link.

Sign out (.logout-btn) is already --on-surface-muted with --on-surface
on hover from a prior pass — exactly the muted treatment the new spec
asks for, so no change needed. The 'Sign out is currently terracotta'
line in the spec didn't match the codebase; flagged in the audit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-12 14:53:11 +02:00

300 lines
8.4 KiB
Text

---
import BaseLayout from './BaseLayout.astro';
import type { UserPublic } from '../lib/db';
interface Props {
title: string;
user: UserPublic;
}
const { title, user } = Astro.props;
const navLinks = [
{ href: '/pulse', label: 'Pulse' },
{ href: '/roadmap', label: 'Roadmap' },
];
const footerLinks = [
{ href: '/vision', label: 'Vision' },
];
const currentPath = Astro.url.pathname;
const year = new Date().getFullYear();
---
<BaseLayout title={title}>
<div class="app">
<header class="nav" role="banner">
<div class="nav-inner">
<a href="/" class="wordmark-link" aria-label="Project Bifrost — home">
<img src="/logo.svg" alt="Fenja AI" class="wordmark" />
<span class="wordmark-sep" aria-hidden="true">·</span>
<span class="wordmark-project">Project <em class="wordmark-bifrost">Bifrost</em></span>
</a>
<nav class="nav-right" aria-label="Main navigation">
{navLinks.map(({ href, label }) => (
<a
href={href}
class:list={['nav-link', { active: currentPath === href || (href !== '/' && currentPath.startsWith(href)) }]}
>
{label}
</a>
))}
{user.role === 'fenja' && (
<a
href="/admin"
class:list={['nav-link', { active: currentPath.startsWith('/admin') }]}
>
Admin
</a>
)}
<span class="nav-divider" aria-hidden="true"></span>
<a href="/account" class="nav-user-name body-sm">{user.name}</a>
<form method="POST" action="/api/logout" class="nav-logout-form">
<button type="submit" class="logout-btn label-sm">Sign out</button>
</form>
</nav>
</div>
</header>
<main class="main-content">
<slot />
</main>
<footer class="footer" role="contentinfo">
<div class="footer-inner">
<div class="footer-left">
<img src="/logo-icon.svg" alt="" class="footer-mark" />
<span class="footer-copy label-sm">© {year} Fenja AI</span>
</div>
<nav class="footer-links" aria-label="Secondary">
{footerLinks.map(({ href, label }) => (
<a href={href} class="footer-link label-sm">{label}</a>
))}
</nav>
</div>
</footer>
</div>
</BaseLayout>
<style>
.app {
min-height: 100vh;
background: var(--background);
display: flex;
flex-direction: column;
}
/* ── Nav ────────────────────────────────────────────────────────── */
.nav {
position: sticky;
top: 0;
z-index: 100;
background: var(--glass-surface);
backdrop-filter: var(--glass-blur);
-webkit-backdrop-filter: var(--glass-blur);
border-bottom: var(--ghost-border);
}
.nav-inner {
display: flex;
align-items: center;
gap: var(--space-6);
padding: 0 var(--space-10);
height: 56px;
max-width: var(--content-max);
margin: 0 auto;
width: 100%;
}
.wordmark-link {
flex-shrink: 0;
display: flex;
align-items: center;
gap: 12px;
border-bottom: none;
color: var(--on-surface);
line-height: 1; /* belt + braces — no nav-row leading on the lockup */
}
.wordmark-link:hover {
border-bottom: none;
color: var(--on-surface);
}
.wordmark {
height: 20px;
width: auto;
display: block;
}
.wordmark-sep {
color: var(--on-surface-muted);
font-family: var(--font-serif);
font-size: 18px;
line-height: 1;
/* Optical kern — the bullet's typographic centre sits slightly above
its baseline in Newsreader; this nudges it onto the visual midline. */
transform: translateY(-2px);
}
.wordmark-project {
font-family: var(--font-serif);
font-size: 18px;
font-weight: 400;
line-height: 1.5; /* enough room for italic 'B' ascender + the gradient's clip box */
color: var(--on-surface);
letter-spacing: var(--tracking-snug);
}
.wordmark-bifrost {
/* display: inline-block + padding lifts the gradient-clip bounding
box above the italic 'B' ascender so the cap doesn't render cut off. */
display: inline-block;
padding: 4px 0 2px;
font-family: var(--font-serif);
font-style: italic;
font-weight: 400;
line-height: 1;
background-image: linear-gradient(
90deg,
var(--pigment-terracotta) 0%,
var(--pigment-ochre) 28%,
var(--pigment-copper) 54%,
var(--pigment-indigo) 78%,
var(--pigment-heather) 100%
);
-webkit-background-clip: text;
background-clip: text;
color: transparent;
}
/* ── Nav links ──────────────────────────────────────────────────── */
.nav-right {
display: flex;
align-items: center;
gap: var(--space-1);
margin-left: auto;
}
.nav-divider {
display: inline-block;
width: 1px;
height: 18px;
background: rgba(0, 0, 0, 0.15);
margin: 0 18px;
transform: scaleX(0.5);
transform-origin: center;
}
.nav-logout-form { display: inline-flex; }
.nav-link {
position: relative;
font-family: var(--font-sans);
font-size: var(--text-label-md);
font-weight: 500;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
color: var(--on-surface-variant);
text-decoration: none;
padding: var(--space-2) var(--space-3);
border-radius: var(--radius-sm);
border-bottom: none;
transition: color var(--duration-fast) var(--ease-standard);
}
.nav-link:hover {
color: var(--on-surface);
border-bottom: none;
}
/* Active nav link: terracotta + slightly heavier weight. Colour alone
is the indicator — no badge, bullet, italic, or family swap. */
.nav-link.active {
color: var(--pigment-terracotta);
font-weight: 500;
}
/* ── User zone ──────────────────────────────────────────────────── */
.nav-user-name {
color: var(--on-surface-variant);
text-decoration: none;
border-bottom: none;
transition: color var(--duration-fast) var(--ease-standard);
}
.nav-user-name:hover {
color: var(--on-surface);
border-bottom: none;
}
.logout-btn {
background: none;
border: none;
cursor: pointer;
font-family: var(--font-sans);
font-size: var(--text-label-md);
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
color: var(--on-surface-muted);
padding: var(--space-2) var(--space-3);
border-radius: var(--radius-sm);
transition: color var(--duration-fast) var(--ease-standard),
background var(--duration-fast) var(--ease-standard);
}
.logout-btn:hover {
color: var(--on-surface);
background: var(--surface-container-low);
}
/* ── Content ────────────────────────────────────────────────────── */
.main-content {
flex: 1;
}
/* ── Footer ─────────────────────────────────────────────────────── */
.footer {
margin-top: var(--space-16);
padding: var(--space-6) 0;
border-top: var(--ghost-border);
}
.footer-inner {
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-6);
padding: 0 var(--space-10);
max-width: var(--content-max);
margin: 0 auto;
width: 100%;
}
.footer-left {
display: flex;
align-items: center;
gap: var(--space-3);
}
.footer-mark {
height: 16px;
width: auto;
display: block;
opacity: 0.7;
}
.footer-copy {
color: var(--on-surface-muted);
letter-spacing: var(--tracking-wide);
font-weight: 400;
}
.footer-links {
display: flex;
gap: var(--space-5);
}
.footer-link {
color: var(--on-surface-muted);
text-decoration: none;
border-bottom: none;
letter-spacing: var(--tracking-wide);
text-transform: uppercase;
transition: color var(--duration-fast) var(--ease-standard);
}
.footer-link:hover {
color: var(--on-surface-variant);
border-bottom: none;
}
</style>