/* ==========================================================================
   shell.css — the shared frame for tool pages
   ==========================================================================

   A slim bar above a tool: the site's name, the tool's name, a way back to
   the collection, and the ink/paper switch. It consumes the site tokens, so
   it follows whichever palette is active.

   This is the pilot version: a page opts in with the markup and a
   `has-site-frame` class on <body>. It does not restyle the tool itself.
   ========================================================================== */

header.site-frame {
    display: block !important;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    text-align: left;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: 0 !important;
    border-bottom: 1px solid var(--border-strong, #403a2d) !important;
}

body.has-site-frame {
    background: var(--bg-primary, #0b0a08);
    color: var(--text-primary, #efe8d9);
    font-family: var(--font-sans, system-ui, sans-serif);
}

.site-frame {
    position: sticky;
    top: 0;
    z-index: 900;
    background: color-mix(in srgb, var(--bg-primary, #0b0a08) 88%, transparent);
    border-bottom: 1px solid var(--border-strong, #403a2d);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.sf-inner {
    width: 100%;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.4rem clamp(0.9rem, 3vw, 1.5rem);
    min-height: 3.1rem;
}

.sf-brand {
    font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
    font-size: 1.05rem;
    line-height: 1;
    color: var(--text-primary, #efe8d9);
    text-decoration: none;
    white-space: nowrap;
}
.sf-brand span {
    color: var(--accent, #c9a24a);
}
.site-frame span,
.site-frame-foot span {
    padding: 0;
}
.sf-brand:hover {
    color: var(--accent, #c9a24a);
}

.sf-tool {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted, #857c6a);
    padding-left: 0.85rem;
    border-left: 1px solid var(--border-strong, #403a2d);
    white-space: nowrap;
}

.sf-inner nav {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: auto;
}

.sf-link {
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.68rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary, #b8ae9b);
    text-decoration: none;
    white-space: nowrap;
}
.sf-link:hover {
    color: var(--accent, #c9a24a);
}

.sf-theme {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    border: 1px solid var(--border-strong, #403a2d);
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary, #b8ae9b);
    cursor: pointer;
}
.sf-theme:hover {
    border-color: var(--accent, #c9a24a);
    color: var(--accent, #c9a24a);
}
.sf-theme svg {
    width: 1.05rem;
    height: 1.05rem;
}
.sf-theme .icon-moon {
    display: none;
}
html[data-theme='light'] .sf-theme .icon-sun {
    display: none;
}
html[data-theme='light'] .sf-theme .icon-moon {
    display: block;
}

/* The frame replaces the floating theme gear on pages that opt in. */
body.has-site-frame .theme-switcher {
    display: none !important;
}

/* The clock's app fills the viewport; take the bar's height out of it. */
body.has-site-frame .app {
    min-height: calc(100svh - 3.1rem);
}

.tool-notes {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding: 0 clamp(0.9rem, 3vw, 1.5rem);
    color: var(--text-muted, #857c6a);
    font-size: 0.8rem;
    line-height: 1.55;
}
.tool-notes p { margin: 0.25rem 0; }

footer.site-frame-foot {
    display: block;
    width: 100%;
    max-width: none;
    margin-top: auto;
    padding-top: 2.5rem;
    border-radius: 0;
    border-top: 1px solid var(--border-strong, #403a2d);
    background: var(--bg-primary, #0b0a08);
}

.sf-foot-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem 2rem;
    flex-wrap: wrap;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0.9rem clamp(0.9rem, 3vw, 1.5rem) 1.1rem;
}

.sf-foot-brand {
    font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', serif;
    font-size: 1rem;
    color: var(--text-primary, #efe8d9);
}
.sf-foot-brand span {
    color: var(--accent, #c9a24a);
}

.sf-foot-inner nav {
    display: flex;
    align-items: center;
    gap: 1.2rem;
    flex-wrap: wrap;
}

.sf-foot-inner a,
.sf-foot-link {
    display: inline-flex;
    align-items: center;
    min-height: 2.75rem;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 0.66rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-secondary, #b8ae9b);
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}
.sf-foot-inner a:hover,
.sf-foot-link:hover {
    color: var(--accent, #c9a24a);
}

@media (max-width: 560px) {
    .sf-inner {
        gap: 0.6rem;
    }
    .sf-tool {
        display: none;
    }
    .sf-inner nav {
        gap: 0.7rem;
    }
    .sf-link {
        font-size: 0.62rem;
    }
}

@media print {
    .site-frame {
        display: none;
    }
}
