/* ============================================================
   The Book Development Service · shared shell
   Redesign 01 · Palimpsest · September 2026
   Owns: colour tokens, typefaces and scale, nav (folio bar),
   footer (colophon), links, buttons, focus, and the Tier 2
   ghosted phrase. Page-specific CSS stays in each page.
   A quarter's palette and type change is one edit here.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400;1,500&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
    /* Palimpsest palette */
    --ink:          #14161B;
    --ink-raised:   #1C2027;
    --ink-deep:     #0F1116;
    --vellum:       #EAE6D9;
    --vellum-dim:   #9E9A8C;
    --reveal:       #35695F;
    --reveal-deep:  #24473F;
    --reveal-lit:   #7FA79E;
    --oxide:        #C9814F;
    --rubric:       #B4472A;

    --serif: 'EB Garamond', Georgia, 'Times New Roman', serif;
    --mono:  'IBM Plex Mono', 'SFMono-Regular', Menlo, Consolas, monospace;

    /* Type scale */
    --t-1: 0.62rem; --t-2: 0.72rem; --t-3: 0.86rem; --t-4: 1rem;
    --t-5: 1.12rem; --t-6: 1.5rem;  --t-7: 2.2rem;  --t-8: 3.4rem;
    --t-under: clamp(7rem, 20vw, 17rem);

    /* Bridge: every page's existing tokens now resolve to the palette */
    --bg:             var(--ink);
    --bg-subtle:      var(--ink-raised);
    --bg-tint:        var(--ink-raised);
    --bg-dark:        var(--ink-deep);
    --bg-warm:        var(--ink-raised);
    --bg-cream:       var(--ink);
    --bg-card:        var(--ink-raised);
    --text:           var(--vellum);
    --text-secondary: #BBB6A7;
    --text-tertiary:  var(--vellum-dim);
    --text-dark:      var(--vellum);
    --text-light:     var(--vellum-dim);
    --text-body:      #BBB6A7;
    --text-2:         #BBB6A7;
    --text-3:         var(--vellum-dim);
    --accent:         var(--reveal-lit);
    --accent-hover:   #9CBFB6;
    --accent-faint:   rgba(53, 105, 95, 0.16);
    --accent-medium:  var(--reveal);
    --accent-dim:     var(--reveal-deep);
    --gold:           var(--oxide);
    --gold-faint:     rgba(201, 129, 79, 0.14);
    --gold-deep:      #A8673A;
    --rule:           var(--reveal-deep);
    --rule-light:     #262C2E;
    --font-display:   var(--serif);
    --font-body:      var(--serif);
    --display:        var(--serif);
    --body:           var(--serif);
}

html { font-size: 106.25%; overflow-x: hidden; }
body {
    font-family: var(--serif);
    color: var(--vellum);
    background-color: var(--ink);
    background-image: none;
    overflow-x: hidden;
}
::selection { background: var(--oxide); color: var(--ink); }

/* Apparatus: every label, eyebrow and byline is set in the mono */
.label, .eyebrow, .kit-label, .article-meta, .article-byline, .related-reading-label,
.related-label, .footer-links-label, .bp-preview-label, .anatomy-doc-eyebrow,
.anatomy-detail-eyebrow, .anatomy-excerpt-label, .anatomy-why-label, .anatomy-doc-foot,
.stat-label, .splash-sub-text, .scroll-indicator span, .chapter-label, .sb-cover-type,
.evidence-src, .back-link, .article-back, .start-label, .step-label, .sp-label, .mi-label {
    font-family: var(--mono);
    font-weight: 400;
}

/* Folio bar: every nav variant on the site */
.nav, .article-nav, .sample-nav, .mi-nav, .sp-nav, .sb-nav, .kit-nav, .bp-nav, .bp-nav-top {
    background: rgba(20, 22, 27, 0.92);
    border-bottom: 1px solid var(--reveal-deep);
}
@supports ((-webkit-backdrop-filter: blur(10px)) or (backdrop-filter: blur(10px))) {
    .nav, .article-nav, .sample-nav, .mi-nav, .sp-nav, .sb-nav {
        background: rgba(20, 22, 27, 0.84);
        -webkit-backdrop-filter: blur(10px);
        backdrop-filter: blur(10px);
    }
}
.nav.visible { border-bottom-color: var(--reveal-deep); }
.nav-links a, .article-nav-links a, .sample-nav a, .sample-nav-links a, .mi-nav a, .sp-nav a, .sb-nav a,
.sb-nav-links a, .kit-nav a {
    font-family: var(--mono);
    font-size: var(--t-2);
    letter-spacing: 0.04em;
    color: var(--vellum-dim);
    white-space: nowrap;
}
.nav-links, .article-nav-links, .sb-nav-links { gap: 1.6rem; }
.nav-links a:hover, .article-nav-links a:hover, .sample-nav a:hover, .sb-nav a:hover { color: var(--vellum); }
.nav-links.open, .article-nav-links.open, .sample-nav-links.open, .sb-nav-links.open {
    background: var(--ink-deep);
    border-bottom: 1px solid var(--reveal-deep);
}
.nav-toggle span { background: var(--vellum); }
/* The four pages on the article bar (start, finished-manuscripts, the-writing-partnership, request-blueprint):
   the bar must be the dropdown's anchor and both must sit above the raised leaves, or the phone menu
   opens below the fold and behind the page. */
.article-nav { position: relative; z-index: 40; }
.article-nav-links.open { z-index: 41; }
.wm-main { font-family: var(--serif) !important; fill: var(--vellum); }
.wm-sub  { font-family: var(--mono) !important; fill: var(--reveal-lit); }
.wm-rule { stroke: var(--reveal); }
.nav-brand .wm-main, .article-nav-brand .wm-main, .sample-nav .wm-main, .sb-nav .wm-main { fill: var(--vellum); }
.nav-brand .wm-sub, .article-nav-brand .wm-sub, .sample-nav .wm-sub, .sb-nav .wm-sub { fill: var(--reveal-lit); }
.nav-brand .wm-rule, .article-nav-brand .wm-rule { stroke: var(--reveal); }

/* Calls to action: the single accent, and the only place it fills a shape */
.nav-links .nav-cta, .article-nav-links .nav-cta, .nav-cta,
.cta-btn, .article-cta-btn, .hero-cta, .form-submit, .vi-cta, .faq-crosslink,
.bp-preview-cta-link, .anatomy-cta, .start-cta-btn, .btn-primary, .mi-submit {
    font-family: var(--mono);
    font-size: var(--t-2);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ink);
    background: var(--oxide);
    border-radius: 0;
    border: none;
    max-width: 100%;
    line-height: 1.45;
}
.nav-links .nav-cta:hover, .article-nav-links .nav-cta:hover, .nav-cta:hover,
.cta-btn:hover, .article-cta-btn:hover, .hero-cta:hover, .form-submit:hover, .vi-cta:hover,
.faq-crosslink:hover, .bp-preview-cta-link:hover, .anatomy-cta:hover, .start-cta-btn:hover, .btn-primary:hover {
    background: var(--vellum);
    color: var(--ink);
}
.hero-start-link { font-family: var(--mono); font-size: var(--t-2); letter-spacing: 0.08em; text-transform: uppercase; border-radius: 0; border-width: 1px; }
.hero-start-link:hover { background: var(--reveal-lit); color: var(--ink); }
a[href*="cal.com"][style*="border"], a[style*="background: var(--accent)"] {
    font-family: var(--mono) !important;
    border-radius: 0 !important;
    letter-spacing: 0.06em;
    color: var(--ink) !important;
}
a[href*="cal.com"][style*="border"] { color: var(--reveal-lit) !important; background: transparent !important; }

/* Links */
a { color: inherit; }
.article-body a, .prose a, p a { color: var(--reveal-lit); }
.article-body a:hover, p a:hover { color: var(--vellum); }

/* Focus */
:focus-visible { outline: 2px solid var(--oxide); outline-offset: 3px; }

/* Rules, dividers, drop caps, quotes */
.accent-rule, hr.accent-rule {
    background-image: none;
    background-color: var(--reveal-deep);
    height: 1px;
    width: 6rem;
}
.drop-cap::first-letter { color: var(--oxide); }
.pull-quote { color: var(--vellum); border-left-color: var(--oxide); }
.pull-quote::after { background: var(--oxide); }

/* Colophon: every footer variant */
footer, .sb-footer, .rv-footer, .sp-footer, .page-footer {
    background: var(--ink-deep);
    border-top: 1px solid var(--reveal-deep);
    color: var(--vellum-dim);
    font-family: var(--mono);
}
footer p { font-size: var(--t-2); line-height: 1.8; }
footer a, .footer-links a { color: var(--vellum-dim) !important; border-bottom-color: var(--reveal-deep) !important; }
footer a:hover, .footer-links a:hover { color: var(--vellum) !important; }
.footer-brand .wm-main { fill: var(--vellum-dim); }
.footer-brand .wm-sub { fill: var(--reveal); }
.footer-brand .wm-rule { stroke: var(--reveal-deep); }
.footer-links { border-top-color: var(--reveal-deep); }
.footer-links-label { color: var(--reveal-lit); }
/* collation line */
.footer-inner::before {
    content: 'redesign i · palimpsest · ix · mmxxvi';
    display: block;
    width: 100%;
    font-size: var(--t-1);
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--reveal);
}

/* Forms, everywhere */
input, select, textarea {
    font-family: var(--serif);
    color: var(--vellum);
    background: var(--ink-deep);
    border-color: var(--reveal-deep);
    border-radius: 0;
}
input:focus, select:focus, textarea:focus { border-color: var(--reveal-lit); }
::placeholder { color: var(--vellum-dim); }

/* Tier 2: one ghosted phrase behind the page header.
   The phrase lives in data-text and is drawn by CSS, so it is never page text. */
.ghosted {
    display: block;
    position: relative;
    height: 0;
    overflow: visible;
    pointer-events: none;
    z-index: 0;
}
.ghosted::before {
    content: attr(data-text);
    position: absolute;
    left: -0.06em;
    top: -0.62em;
    font-family: var(--serif);
    font-style: italic;
    font-weight: 400;
    font-size: clamp(3.6rem, 11vw, 8.5rem);
    line-height: 0.95;
    white-space: nowrap;
    max-width: calc(100vw - 3rem);
    overflow: hidden;
    color: var(--reveal);
    opacity: 0.45;
    filter: blur(1px);
    transform: rotate(-3deg);
    transform-origin: left top;
    will-change: transform;
}
.ghosted + h1, .ghosted ~ h1 { position: relative; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
    .ghosted::before { transform: none; }
}

/* Filled controls elsewhere on the site: ink text on the light fill, never white on it */
.bp-btn-primary, .bp-download-btn, .btn-primary, .dx-cta-primary, .fit-result-cta,
.mi-chip[aria-pressed="true"], .mi-submit, .nav-cta-link, .open-btn, .rb-submit, .rv-dl-btn,
.start-cta-btn, .story-cta-btn, .vc-share-btn, .deeper-link, .live-cta a, .dl a.doc,
.package-check, .format-chosen-tag, .sampler-chosen-tag, .show-tier, .site-visit, .site-from,
.keynote-from, .platform-flow-source, .platform-card .card-source, .btn-secondary:hover,
.rv-open-btn:hover, .story-cta-secondary:hover, .sb-banner a, .sb-end-wall a.cta-btn {
    color: var(--ink) !important;
}
.mi-chip[aria-pressed="true"] { border-color: var(--reveal-lit); }

/* Homepage mobile hero breathing room */
@media (max-width: 760px) {
    .pal-home .hero { padding-left: 0.6rem; padding-right: 0.6rem; }
}

/* Folio bar between phone and desktop: the serif is narrower than the mono.
   Raised from 1000px to 1340px on 6 September 2026. The full-size nav overflows its own
   1080px column, so it needs roughly a 1310px window before the last item sits clear of
   the right edge. Between 1001px and that point the Book a Discovery Call button was cut
   off, which is what an iPad Pro 13 inch in portrait (1024px) showed. */
@media (max-width: 1340px) and (min-width: 641px) {
    .nav-links a, .article-nav-links a, .sample-nav a, .sample-nav-links a, .sb-nav a, .sb-nav-links a {
        font-family: var(--serif); font-size: 0.92rem; letter-spacing: 0;
    }
    .nav-links, .article-nav-links, .sb-nav-links { gap: 1.1rem; }
    .nav-links .nav-cta, .article-nav-links .nav-cta { font-family: var(--mono); font-size: var(--t-1); padding: 0.5rem 0.8rem; }
}

/* Sample-page banner: inline text, not flex items */
.sample-indicator-inner { display: block; }
.sample-indicator-inner strong { margin-right: 0.35em; }

/* Phones: every filled call to action may wrap, and the small utility bars wrap their links */
@media (max-width: 640px) {
    .cta-btn, .article-cta-btn, .hero-cta, .form-submit, .vi-cta, .faq-crosslink, .anatomy-cta,
    .start-cta-btn, .btn-primary, .mi-submit, .bp-preview-cta-link {
        white-space: normal; text-align: center; letter-spacing: 0.06em;
    }
    .sb-nav a, .mi-nav a, .sp-nav a, .sample-nav a, .sample-nav-links a { white-space: normal; font-size: var(--t-1); }
    .sb-nav, .mi-nav, .sp-nav { flex-wrap: wrap; gap: 0.5rem 1rem; }
}
/* Folio bar between the phone menu and the wide layout: the links wrap onto a second row
   rather than run off the edge. Raised from 900px to 1080px on 6 September 2026: below
   about 1080px the shrunk nav still leaves no clear space between the wordmark and the
   links, so the call to action drops to its own right-aligned row instead. */
@media (max-width: 1080px) and (min-width: 641px) {
    .article-nav-links, .nav-links { flex-wrap: wrap; justify-content: flex-end; row-gap: 0.35rem; }
}
