/* The sign-off: the last thing on the homepage, the FAQ and the projects
   page, and their footer. Its own file so all three load the same one. */

/* The page's line, as the homepage draws it, for the pages that do not load
   the homepage's stylesheet. */
.sign-off .home-bleed {
    max-width: 3000px;
    margin-inline: auto;
    padding-inline: 40px;
}

@media (max-width: 768px) {
    .sign-off .home-bleed { padding-inline: 28px; }
}

@media (max-width: 480px) {
    .sign-off .home-bleed { padding-inline: 24px; }
}

/* --- The sign-off ---
   The last thing on the card and the page's footer in one. A line of large
   type running across the screen, the one request beside the one way to make
   it, where to go next with the house's mark at the head of the columns, and
   a quiet last line. */
.sign-off {
    position: relative;
    z-index: 1;
    padding-top: clamp(56px, 9vh, 112px);
    color: var(--text-primary);
    /* The page's dark carries on below its end, so pulling past the foot on
       a phone (the rubber band) shows dark, never the moving background
       that stays fixed behind the page. A shadow, so it adds no length. */
    box-shadow: 0 100vh 0 0 #0a0a0e;
}

/* Nothing may push the page wider than the screen: on a phone even a few
   pixels too wide make it sway sideways while scrolling. Set on body as
   clip, which the browser hands to the window: on html, or as hidden on
   body, it would make body a scrolling box of its own, and then nothing
   sticky (the header, the About page's opening) would hold. */
body { overflow-x: clip; }

/* No rubber band past the page's top or foot on a phone; and the moving
   background, fixed behind the whole page, put away once the sign-off is
   on screen (js/sign-off.js), so its dark is all there is below. */
html { overscroll-behavior-y: none; }
.mesh-bg { transition: opacity 0.5s; }
html.at-the-foot .mesh-bg { opacity: 0; }

.so-title {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Room above and below the running line, so its hairlines never touch the
   letters (the descenders of «together» sat on the lower one). */
.so-marquee {
    overflow: hidden;
    padding: 0.3em 0 0.38em;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    font-size: clamp(40px, 5.6vw, 100px);
}

.so-track {
    display: flex;
    width: max-content;
    animation: so-run 46s linear infinite;
}

.so-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    gap: 0.28em;
    padding-right: 0.28em;
    white-space: nowrap;
    font-weight: var(--fw-light);
    letter-spacing: -0.05em;
    line-height: 1.02;
}

.so-group em {
    font-style: italic;
    font-weight: var(--fw-light);
    color: rgba(255, 255, 255, 0.75);
}

.so-group b {
    font-size: 0.32em;
    font-weight: 400;
    color: var(--accent-orange);
    transform: translateY(-0.2em);
}

/* Four copies in the track, so one half covers the widest screen and moving
   it by half returns to where it began. */
@keyframes so-run {
    to { transform: translateX(-50%); }
}

.so-body {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 48px;
    padding-top: clamp(40px, 6vh, 72px);
    padding-bottom: clamp(44px, 7vh, 80px);
}

.so-lead {
    margin: 0;
    max-width: 36ch;
    font-size: clamp(15px, 1.1vw, 18px);
    line-height: 1.6;
    color: var(--text-secondary);
}

/* The request: words, not a button. A hairline underneath that fills with
   the house orange from the left when the pointer arrives. */
.so-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    flex-shrink: 0;
    padding-bottom: 0.18em;
    font-size: clamp(30px, 2.8vw, 48px);
    font-weight: var(--fw-light);
    letter-spacing: -0.045em;
    line-height: 1;
    color: var(--text-primary);
    text-decoration: none;
}

.so-cta::before,
.so-cta::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
}

.so-cta::after {
    background: linear-gradient(90deg, var(--accent-orange), var(--accent-amber));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.9s cubic-bezier(0.65, 0, 0.35, 1);
}

.so-cta svg {
    width: 0.62em;
    height: 0.62em;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.so-cta:hover::after,
.so-cta:focus-visible::after { transform: scaleX(1); }
.so-cta:hover svg,
.so-cta:focus-visible svg { transform: translate(0.12em, -0.12em); }

.so-cols {
    display: grid;
    grid-template-columns: minmax(0, 2fr) repeat(2, minmax(0, 1fr));
    gap: 32px;
    padding-top: 32px;
    padding-bottom: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.so-col {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    min-width: 0;
    font-size: 15px;
}

/* The email is the longest word on the page; on a narrow phone it may
   break rather than run past the screen's edge. */
.so-col a { max-width: 100%; overflow-wrap: anywhere; }

.so-col .so-h {
    margin: 0 0 4px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.72);
}

.so-col a {
    margin: 0;
    color: var(--text-primary);
    text-decoration: none;
    font-variant-numeric: tabular-nums;
}

.so-col a {
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat;
    transition: background-size 0.5s cubic-bezier(0.65, 0, 0.35, 1);
}

.so-col a:hover { background-size: 100% 1px; }

/* The house's own mark at the head of the columns, as in the header, with
   one line under it on what the work is. */
.so-brand .logo { margin-bottom: 10px; }
.so-brand p {
    margin: 0;
    max-width: 26ch;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.75);
}

.so-up {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(255, 255, 255, 0.78);
    text-decoration: none;
    transition: color 0.3s;
}

.so-up:hover { color: var(--text-primary); }

.so-up svg { transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1); }
.so-up:hover svg { transform: translateY(-3px); }

.so-legal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding-top: 18px;
    padding-bottom: clamp(22px, 3vw, 34px);
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    font-size: 15px;
    color: rgba(255, 255, 255, 0.7);
}

.so-legal p { margin: 0; }

@media (max-width: 900px) {
    .so-body { flex-direction: column; align-items: flex-start; gap: 36px; }
    .so-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 36px; }
    .so-brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
    .so-legal { flex-direction: column; gap: 12px; }
}

/* On a phone everything in the sign-off sits centred, one thing under
   another: the request and its button, the mark, each column, the last
   line. */
@media (max-width: 768px) {
    .so-body { align-items: center; text-align: center; }
    .so-lead { margin-inline: auto; }
    .so-cols { grid-template-columns: minmax(0, 1fr); row-gap: 32px; justify-items: center; text-align: center; }
    .so-brand { grid-column: auto; }
    .so-col { align-items: center; }
    .so-brand .logo { justify-content: center; }
    .so-brand p { margin-inline: auto; }
    .so-legal { flex-direction: column; align-items: center; gap: 12px; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    .so-track { animation: none; }
}
