/* Site header: photo + name on the left, pill nav in the middle,
   Say Hello + LinkedIn on the right. After scrolling, only the pill stays. */

.nh {
    --nh-ink: var(--text-pencil, #1A1A18);
    --nh-teal: var(--color-highlight, #266268);
    position: sticky;
    top: 0;
    z-index: 900;
    width: 100%;
    pointer-events: none;
    font-family: var(--font-ui, 'Figtree', sans-serif);
}

.nh-inner {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
}

.nh-brand,
.nh-actions,
.nh-pill {
    pointer-events: auto;
    transition: opacity 0.3s var(--ease-polish, ease), transform 0.3s var(--ease-polish, ease);
}

/* Left: photo and name */
.nh-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    justify-self: start;
    text-decoration: none;
    color: var(--nh-ink);
}

.nh-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 0.5px solid var(--line, #E5E1D8);
    background: #fff;
    display: block;
}

.nh-name {
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -0.01em;
    white-space: nowrap;
}

/* Middle: pill */
.nh-pill {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 5px;
    background: rgba(255, 255, 255, 0.92);
    border: 0.5px solid var(--line, #E5E1D8);
    border-radius: 999px;
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nh-link {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.2;
    color: #3b3b37;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nh-link:hover {
    background: #F1ECE2;
    color: var(--nh-ink);
}

.nh-link.is-active {
    background: var(--nh-teal);
    color: #fff;
}

.nh-link:focus-visible,
.nh-hello:focus-visible,
.nh-icon:focus-visible,
.nh-menu:focus-visible,
.nh-brand:focus-visible {
    outline: 2px solid var(--nh-teal);
    outline-offset: 3px;
}

/* Right: actions */
.nh-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-self: end;
}

.nh-hello,
.nh-icon,
.nh-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    border-radius: 8px;
    background: var(--nh-ink);
    color: #fff;
    border: 1px solid var(--nh-ink);
    text-decoration: none;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.nh-hello {
    padding: 0 16px;
    background: #fff;
    color: var(--nh-ink);
    border-color: var(--nh-ink);
}

.nh-icon,
.nh-menu {
    width: 40px;
    padding: 0;
}

/* LinkedIn: a smaller square in LinkedIn's own blue, so it sits beside Say Hello without outweighing it */
.nh-icon {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: #0A66C2;
    border-color: #0A66C2;
}

.nh-actions .nh-icon:hover {
    background: #004182;
    border-color: #004182;
}

.nh-hello:hover,
.nh-icon:hover,
.nh-menu:hover {
    transform: translate(-1px, -1px);
    background: #33332f;
}

/* Say Hello is a secondary (outline) button: the teal stays for primary CTAs */
.nh-hello:hover {
    background: #F6F1E7;
    color: var(--nh-ink);
    border-color: var(--nh-ink);
}

.nh-hello svg,
.nh-icon svg,
.nh-menu svg {
    width: 16px;
    height: 16px;
    flex: none;
}

.nh-menu {
    display: none;
}

/* Scrolled: keep only the pill */
.nh.is-scrolled .nh-brand,
.nh.is-scrolled .nh-actions {
    opacity: 0;
    transform: translateY(-8px);
    pointer-events: none;
}

/* Mobile menu sheet */
.nh-sheet {
    pointer-events: auto;
    position: absolute;
    top: calc(100% - 4px);
    right: 16px;
    left: 16px;
    padding: 12px;
    background: #fff;
    border: 0.5px solid var(--line, #E5E1D8);
    border-radius: 12px;
    box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.1);
}

.nh-sheet[hidden] {
    display: none;
}

.nh-sheet a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 12px;
    border-radius: 8px;
    color: var(--nh-ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
}

.nh-sheet a:hover,
.nh-sheet a.is-active {
    background: #F1ECE2;
}

.nh-sheet hr {
    border: 0;
    border-top: 1px solid #ece6da;
    margin: 6px 0;
}

/* Tablet: shorter pill */
@media (max-width: 1024px) {
    .nh-hello span {
        display: none;
    }

    .nh-hello {
        width: 40px;
        padding: 0;
    }
}

/* Phone: photo + name left, menu right, no pill */
@media (max-width: 760px) {
    .nh {
        background: rgba(255, 252, 246, 0.9);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-bottom: 1px solid rgba(26, 26, 24, 0.08);
        pointer-events: auto;
    }

    .nh-inner {
        grid-template-columns: 1fr auto;
        padding: 12px 16px;
    }

    .nh-pill {
        display: none;
    }

    /* Menu button: a light outline square like Say Hello, not a heavy black block */
    .nh-menu {
        display: inline-flex;
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: #fff;
        color: var(--nh-ink);
        border: 1px solid rgba(26, 26, 24, 0.18);
        box-shadow: 0 1px 2px rgba(26, 26, 24, 0.06);
    }

    .nh-menu:hover,
    .nh-menu[aria-expanded="true"] {
        background: #F6F1E7;
        border-color: var(--nh-ink);
        transform: none;
    }

    .nh-menu svg {
        width: 20px;
        height: 20px;
        stroke-width: 1.8;
    }

    .nh-icon {
        display: none;
    }

    .nh.is-scrolled .nh-brand,
    .nh.is-scrolled .nh-actions {
        opacity: 1;
        transform: none;
        pointer-events: auto;
    }

    .nh-avatar {
        width: 36px;
        height: 36px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nh-brand,
    .nh-actions,
    .nh-pill,
    .nh-link {
        transition: none;
    }
}

/* Say Hello copies the email: button state and a small toast */
.nh-hello.is-copied {
    background: #E8F1F1;
    color: var(--nh-teal);
    border-color: var(--nh-teal);
}

.nh-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 2000;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
    padding: 12px 18px 12px 14px;
    border-radius: 999px;
    background: var(--text-pencil, #1A1A18);
    color: #fff;
    font-family: var(--font-ui, sans-serif);
    font-size: 14px;
    box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.12);
    opacity: 0;
    transform: translate(-50%, 16px);
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.nh-toast.is-on {
    opacity: 1;
    transform: translate(-50%, 0);
}

.nh-toast svg {
    flex: none;
    width: 18px;
    height: 18px;
    padding: 3px;
    border-radius: 50%;
    background: var(--color-highlight, #266268);
    box-sizing: content-box;
}

.nh-toast strong {
    font-weight: 700;
    margin-right: 4px;
}

.nh-toast span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
    .nh-toast {
        transition: none;
    }
}

/* Home link: hidden at the top (the photo and name are the home link there),
   slides into the pill once the photo and name fade out */
.nh-link.nh-home {
    max-width: 0;
    padding-left: 0;
    padding-right: 0;
    margin-right: -2px;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    white-space: nowrap;
    transition: max-width 0.3s ease, padding 0.3s ease, margin 0.3s ease, opacity 0.2s ease, visibility 0s linear 0.3s, background-color 0.2s ease, color 0.2s ease;
}

.nh.is-scrolled .nh-link.nh-home {
    max-width: 90px;
    padding-left: 16px;
    padding-right: 16px;
    margin-right: 0;
    opacity: 1;
    visibility: visible;
    transition: max-width 0.3s ease, padding 0.3s ease, margin 0.3s ease, opacity 0.2s ease 0.1s, visibility 0s, background-color 0.2s ease, color 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
    .nh-link.nh-home,
    .nh.is-scrolled .nh-link.nh-home {
        transition: none;
    }
}

/* Name as a handwritten signature (Herr Von Muellerhoff, picked 2026-10-01) */
.nh-name {
    font-family: 'Herr Von Muellerhoff', cursive;
    font-weight: 400;
    font-size: 1.95rem;
    letter-spacing: 0;
    line-height: 1;
    color: var(--text-pencil, #1A1A18);
    transform: translateY(3px) rotate(-3deg);
    display: inline-block;
}

/* Phones (asked 4 Oct 2026): header keeps only the name and the menu button.
   Say Hello and Ask me anything live in the menu; the signature name is smaller. */
@media (max-width: 760px) {
    .nh-actions .nh-hello { display: none !important; } /* beats type.css, which loads later */
    .nh-name { font-size: 1.5rem; }
}

/* Case study pages (asked 2026-10-04): no Work / Growth / About / Ask pill, top or floating.
   Name and actions stay; actions keep their place on the right. The phone menu is untouched. */
body[data-page="case"] .nh-pill { display: none !important; }
body[data-page="case"] .nh-actions { grid-column: 3; }
@media (max-width: 760px) {
    body[data-page="case"] .nh-actions { grid-column: auto; }
}

/* Copy my email (asked 2026-10-04): card slides up from the bottom with the full address,
   the button pops and a small confetti burst flies out (script.js) */
.copy-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    z-index: 3000;
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: calc(100vw - 32px);
    padding: 8px 16px 8px 8px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid var(--line, #E5E1D8);
    box-shadow: 0 10px 28px rgba(26, 26, 24, 0.14), 3px 3px 0 rgba(0, 0, 0, 0.06);
    font-family: var(--font-ui, sans-serif);
    color: var(--text-pencil, #1A1A18);
    opacity: 0;
    transform: translate(-50%, 140%);
    pointer-events: none;
    transition: transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.copy-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.copy-toast-check {
    flex: none;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--color-highlight, #266268);
    color: #fff;
}
.copy-toast-check svg { width: 14px; height: 14px; }
.copy-toast-check path { stroke-dasharray: 24; stroke-dashoffset: 24; }
.copy-toast.is-on .copy-toast-check path { animation: copy-tick 0.4s 0.25s ease-out forwards; }
.copy-toast-text { display: flex; flex-direction: column; gap: 0; min-width: 0; }
.copy-toast-text strong { font-size: 11px; font-weight: 600; line-height: 1.3; color: #6B6B66; }
.copy-toast-email {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--text-pencil, #1A1A18);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@keyframes copy-tick { to { stroke-dashoffset: 0; } }

.footer-copy.is-copied { animation: copy-pop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes copy-pop {
    0% { transform: scale(1); }
    35% { transform: scale(0.92); }
    70% { transform: scale(1.06); }
    100% { transform: scale(1); }
}

.copy-bit {
    position: fixed;
    z-index: 2999;
    width: 7px;
    height: 10px;
    margin: -5px 0 0 -3px;
    border-radius: 2px;
    pointer-events: none;
    animation: copy-bit 0.85s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes copy-bit {
    0% { opacity: 1; transform: translate(0, 0) rotate(0) scale(0.6); }
    70% { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--dx), calc(var(--dy) + 30px)) rotate(var(--rot)) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .copy-toast { transition: opacity 0.2s ease; transform: translate(-50%, 0); }
    .copy-toast-check path { stroke-dashoffset: 0; animation: none !important; }
    .footer-copy.is-copied { animation: none; }
}

/* Phones (asked 2026-10-04): every CTA button is full width with its label centred, and rows
   of buttons stack. Covers home, work, growth, about (timeline links) and case study pages. */
@media (max-width: 760px) {
    .tl-link,
    .rw-btn,
    .gr-btn,
    .gr-go,
    .gr-brand-report,
    .lt-btn,
    .mobile-case-study-btn,
    .btn-filled,
    .cn-actions .footer-copy {
        display: flex !important;
        width: 100% !important;
        max-width: none !important;
        justify-content: center !important;
        box-sizing: border-box;
        text-align: center;
    }
    .lt-actions,
    .gr-actions,
    .cn-actions {
        flex-direction: column;
        align-items: stretch !important;
    }
    /* hero: the Resume button keeps a fixed width, centred under the intro (asked 5 Oct 2026);
       the Wall of Portfolios badge keeps its size */
    .cta-container { width: 100%; }
    .cta-container > .btn-filled { align-self: center; width: 200px !important; }
}
