/* Follow-up tweaks, linked after site.css (see layout.tsx), so these rules win over it.
   Sizes scale with the page width (cqi of the site root) between a phone and a desktop value. */

/* The solid colour browsers paint outside the page: Safari 26's status bar and bottom toolbar (it ignores
   theme-color and reads the html/body background-color; background images such as the grain are never
   sampled), and Chrome for iOS's strips beside the notch in landscape (it doesn't honour viewport-fit=cover).
   The page is #fcfcfb under the grain, which averages #f5f5f4 on screen, so that average is the
   background-color the browsers read. What html and body show inside the window stays the page itself:
   the grain over a #fcfcfb layer, both images, which cover the background-color. */
html,
body {
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -.162 0 0 0 .108'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E") 0 0/220px 220px, linear-gradient(#fcfcfb, #fcfcfb) #f5f5f4!important
}

/* Phones in landscape: the page runs under the notch (viewport-fit=cover in layout.tsx) so the
   grain background reaches both screen edges, with the content kept inside the safe area. */
[data-cursor-root] {
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px)
}
@container (max-width:859.98px) {
    .nv1a {
        bottom: max(22px, env(safe-area-inset-bottom, 0px))
    }
}

/* About, experience: dates a size smaller than the role under each company (12px on phones, 13px on desktop). */
.lv-date {
    font-size: clamp(.75rem, .6rem + .45cqi, .8125rem)
}

/* About, daily stack on phones: smaller icons, closer together, moving faster. */
@container (max-width:599.98px) {
    .lv-ic {
        width: 3.5rem;
        height: 3.5rem;
        background-size: calc(var(--size) * .68)
    }
    .lv-mqg {
        gap: 1.25rem;
        padding-right: 1.25rem
    }
    .lv-mqt {
        animation-duration: 22s
    }
}

/* Life: the lines under each heading, the list numbers and the movie captions scale down on smaller screens. */
.lf3a-root section > p:not(.lf3a-foot),
.lf3a-root section > div > p {
    font-size: clamp(.9063rem, .8rem + .5cqi, 1.0625rem)!important
}
.lv-page .lf3a-num,
.lf3a-num {
    font-size: clamp(1.0625rem, .8rem + 1.2cqi, 1.375rem)!important
}
.lv-page .lf3a-mn,
.lf3a-mn {
    font-size: clamp(1.125rem, .9rem + 1.2cqi, 1.625rem)!important
}
.lf3a-title {
    font-size: clamp(1rem, .85rem + .6cqi, 1.125rem)!important
}

/* Life: less space between sections (56px on phones up to 80px on desktop), e.g. from
   "*ranked from most to least time spent." down to "movies". */
.lf3a-root {
    gap: clamp(3.5rem, 2.5rem + 3cqi, 5rem)!important
}

/* Footer: the rule above "my inbox is always open." sits halfway between the page and the heading. */
.lv-ft {
    margin-top: 3.25rem!important
}
.lv-ft > .lv-ft-row:first-child {
    padding-top: 3.25rem!important
}
@container (max-width:599.98px) {
    .lv-ft {
        margin-top: 2.75rem!important
    }
    .lv-ft > .lv-ft-row:first-child {
        padding-top: 2.75rem!important
    }
}

/* About: the same scaling as Life for the text under the heading, company names, roles and photo captions. */
.lv-page > h2.lv-serif + div {
    font-size: clamp(.9063rem, .8rem + .5cqi, 1.0938rem)!important
}
.lv-row .lv-serif[style*="1.4375rem"] {
    font-size: clamp(1.1875rem, 1rem + .8cqi, 1.4375rem)!important
}
.lv-row span[style*="0.9375rem"],
.lv-row div[style*="0.9375rem"] {
    font-size: clamp(.8438rem, .75rem + .4cqi, .9375rem)!important
}
.lv-campus figcaption {
    font-size: clamp(.875rem, .8rem + .4cqi, .9704rem)!important
}

/* About: section labels (MY DAILY STACK, EXPERIENCE, ...) the same size as Life's SHORT-TERM / LONG-TERM
   (.lf3a-hd, 12.65px), sitting closer to what they introduce, with a little less space between sections. */
.lv-label {
    font-size: .7906rem
}
.lv-page:has(> .lv-top) > .lv-label,
.lv-page:has(> .lv-top) > div:has(> .lv-label) {
    margin-top: clamp(2.75rem, 2rem + 3cqi, 4rem)!important
}
.lv-page:has(> .lv-top) > .lv-label + div {
    margin-top: clamp(.125rem, -.25rem + 1.2cqi, .75rem)!important
}
.lv-page:has(> .lv-top) > .lv-label + .lv-campus {
    margin-top: clamp(.75rem, .5rem + 1cqi, 1.375rem)!important
}
@container (max-width:599.98px) {
    .lv-mqv {
        margin-top: .375rem
    }
}

/* Touch screens (phones, tablets): tapping a photo or poster doesn't lift or scale it. (About's top photos
   need nothing here: their hover lift is already mouse-only in site.css, and setting their transform here
   would override the phone layout's own.) */
@media (hover:none), (pointer:coarse) {
    .lv-campus .lv-frame:hover {
        transform: none!important
    }
    .lf3a-ph:hover .lf3a-img,
    .lf3a-mv:hover .lf3a-poster,
    .lv-ic:hover {
        transform: none
    }
    .lv-ic:hover {
        filter: grayscale(1);
        opacity: .7
    }
    .pc-st>.pc-hov {
        display: none
    }
    .pc-go:hover .pc-st>*:not(.pc-hov) {
        filter: none
    }
    img, [role="img"], .lv-frame, .lf3a-ph, .lf3a-mv, .pc {
        -webkit-tap-highlight-color: transparent
    }
}

/* Home, phones and tablets: tiles without a link end their meta line where the others have the link arrow:
   Harvey says "Coming soon", Amazon (internal work) shows the lock from its desktop hover. */
@container (max-width:859.98px) {
    .pc[aria-label="Coming soon"] .pc-cap>div:first-child,
    .pc-lock .pc-cap>div:first-child {
        position: relative;
        padding-right: 24px
    }
    .pc[aria-label="Coming soon"] .pc-cap>div:first-child {
        padding-right: 9em
    }
    .pc[aria-label="Coming soon"] .pc-cap>div:first-child::after {
        content: "Coming soon";
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        white-space: nowrap;
        color: #6c6873
    }
    .pc-lock .pc-cap>div:first-child::after {
        content: "";
        position: absolute;
        right: 0;
        top: 50%;
        width: 15px;
        height: 15px;
        margin-top: -7.5px;
        background: #6c6873;
        -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2.2'/%3E%3Cpath d='M8.5 10.5V7.8a3.5 3.5 0 0 1 7 0v2.7'/%3E%3C/svg%3E") center/contain no-repeat;
        mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='10.5' width='14' height='10' rx='2.2'/%3E%3Cpath d='M8.5 10.5V7.8a3.5 3.5 0 0 1 7 0v2.7'/%3E%3C/svg%3E") center/contain no-repeat
    }
}

/* Home: Revoteen is the last tile. One column (phones): Harvey, Aida, Amazon, SafePro, CCC, Mirror, Revoteen.
   Two columns: it swaps with CCC at the bottom of the left column (Harvey, Amazon, CCC, Revoteen). */
.pc[data-order="5"] {
    order: 7!important
}
.pc[data-order="7"] {
    order: 5!important
}
