/* =========================================================
   /apps: the hub page. Sits on the main site's styles.css
   (palette, system font, footer, section heading) and adds
   one full-width section per app.

   Carried over from Luggage Logger, on purpose (Tommy, 11 Nov
   2026: layout, animations and the way screenshots are shown
   tie the apps together). Its reference is
   Luggage-Logger/docs/design/look-and-feel.md. Taken from it:
   text one side and screens the other, alternating; a real
   capture with a rounded mask, a hairline edge and a soft
   layered shadow, no device frame; a glow in the app's own
   colour behind the screens (20% in light, 30% in dark); an
   18px fade-up as a block scrolls in, visible by default;
   feedback in 300 ms or less, never ease-in.
   Each app's --accent is its own.
   ========================================================= */

.apps-skip {
    position: absolute; left: 12px; top: -60px; z-index: 200;
    padding: 10px 16px; border-radius: 8px;
    background: var(--ink); color: var(--paper); font-weight: 600;
}
.apps-skip:focus { top: 12px; }

.apps-top { padding: 26px 0 0; }
.apps-home {
    font-family: var(--font-display);
    font-size: 1.08rem;
    font-weight: var(--display-weight);
    letter-spacing: var(--display-tracking);
    color: var(--ink);
    display: inline-block;
    padding: 10px 0;
}
.apps-home .hero-family { color: var(--rust); }
.apps-home:hover .hero-given { color: var(--rust); }
.apps-home:focus-visible,
.app-cta:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 4px;
    border-radius: 6px;
}

.apps-intro { padding: 56px 0 0; }
.apps-lede {
    margin: 26px 0 64px;
    font-size: 1.2rem;
    color: var(--ink-soft);
    max-width: 34em;
}

/* ---------- One app ---------- */
:root { --apps-glow: 30%; --apps-settle: cubic-bezier(0.22, 1, 0.36, 1); }
html[data-theme="light"] { --apps-glow: 20%; }
@media (prefers-color-scheme: light) {
    html[data-theme="system"] { --apps-glow: 20%; }
}

.app {
    --accent: var(--rust);
    --accent-btn: color-mix(in srgb, var(--accent) 78%, #000);
    position: relative;
    border-top: 1px solid var(--hairline);
    background: color-mix(in srgb, var(--accent) 6%, transparent);
    overflow: hidden;
}

.app-inner {
    position: relative;
    display: grid;
    gap: 48px;
    padding-top: 72px;
    padding-bottom: 80px;
}

.app-icon {
    display: block;
    width: 72px; height: 72px;
    border-radius: 22.5%;
    margin-bottom: 26px;
    box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.6);
}
/* The name is sized to its column, so a one-word name never breaks mid-word. */
.app-text { container-type: inline-size; }
.app-name {
    font-size: clamp(2rem, 10cqi, 3.25rem);
    line-height: 1.04;
    margin-bottom: 18px;
}
.app-tagline {
    font-size: clamp(1.2rem, 2.2vw, 1.5rem);
    line-height: 1.35;
    font-weight: 600;
    color: var(--ink);
    max-width: 24em;
    margin-bottom: 18px;
}
.app-blurb {
    color: var(--ink-soft);
    max-width: 34em;
    margin-bottom: 26px;
}
.app-meta {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--ink-soft);
    margin-bottom: 28px;
}
.app-meta-sep::before { content: "·"; margin: 0 0.7em; opacity: 0.6; }
.app-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.6em;
    min-height: 48px;
    padding: 12px 26px;
    border-radius: 999px;
    background: var(--accent-btn);
    color: #fff;
    font-weight: 600;
    transition: background 240ms var(--apps-settle), transform 240ms var(--apps-settle);
}
.app-cta::after { content: "→"; transition: transform 240ms var(--apps-settle); }
.app-cta:hover { background: color-mix(in srgb, var(--accent) 66%, #000); color: #fff; }
.app-cta:hover::after { transform: translateX(4px); }
.app-cta:active { transform: scale(0.96); }

/* ---------- Screens ---------- */
.app-shots { position: relative; isolation: isolate; }
/* The glow behind the screens, in the app's own colour. */
.app-shots::before {
    content: "";
    position: absolute;
    inset: -14% -12%;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) var(--apps-glow), transparent), transparent);
}
/* A real capture: rounded mask, hairline edge, soft layered shadow. No device frame. */
.shot {
    margin: 0;
    box-shadow:
        0 0 0 1px color-mix(in srgb, var(--ink) 16%, transparent),
        0 1px 2px rgba(0, 0, 0, 0.10),
        0 14px 28px -10px rgba(0, 0, 0, 0.26),
        0 40px 70px -30px rgba(0, 0, 0, 0.50);
}
.shot img { display: block; width: 100%; height: auto; border-radius: inherit; }

.shot--iphone { border-radius: 12.4% / 5.7%; }
.shot--watch { border-radius: 21% / 17.6%; }
.shot--mac, .shot--web { border-radius: 12px; }

/* Two phones side by side, the second set lower, the watch tucked under the first. */
.shots--phones {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 5%;
    padding-bottom: 7%;
    max-width: 560px;
    margin: 0 auto;
}
.shots--phones .shot--iphone { flex: 0 0 41%; }
.shots--phones .shot--iphone + .shot--iphone { margin-top: 13%; }
.shots--phones .shot--watch {
    position: absolute;
    left: 0; bottom: 0;
    width: 27%;
}
/* One phone only: let it stand in the middle. */
.shots--phones .shot--iphone:only-child { flex-basis: 52%; }

/* A wide screen with a phone standing in front of its corner, and the watch beside the phone. */
.shots--desk { padding: 0 7% 9% 0; }
.shots--desk .shot--iphone,
.shots--desk .shot--watch {
    position: absolute;
    right: 0; bottom: 0;
    width: 23%;
}
.shots--desk .shot--watch { width: 18%; }
.shots--desk .shot--iphone ~ .shot--watch { right: 26.5%; width: 12.5%; }
.shots--desk .shot--iphone ~ .shot--iphone,
.shots--desk .shot--watch ~ .shot--watch,
.shots--desk .shot--mac ~ .shot--mac,
.shots--desk .shot--web ~ .shot--web,
.shots--desk .shot--mac ~ .shot--web { display: none; }

@media (min-width: 900px) {
    .app-inner {
        grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
        gap: 72px;
        align-items: center;
        min-height: min(92vh, 940px);
        padding-top: 104px;
        padding-bottom: 104px;
    }
    /* First app: words upper left. Second: words lower right. */
    .app-text { align-self: start; }
    .shots--phones .shot--watch { left: -7%; }
    .app--flip .app-text { order: 2; align-self: end; }
    .app--flip .app-shots { order: 1; }
    .app--flip .app-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}
/* Room either side of the column: let a wide screen run out towards the page edge. */
@media (min-width: 1360px) {
    .shots--desk { margin-left: -72px; }
    .app:not(.app--flip) .shots--desk { margin-left: 0; margin-right: -72px; }
}

.apps-more {
    border-top: 1px solid var(--hairline);
    padding: 72px 0 96px;
    text-align: center;
    color: var(--ink-soft);
}

/* ---------- Scroll in ----------
   Everything is visible by default. apps.js marks what starts below the
   fold as waiting, then lets it rise 18px into place as it arrives. */
.apps-js .apps-reveal {
    transition:
        opacity 700ms cubic-bezier(0.22, 1, 0.36, 1),
        transform 700ms cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--i, 0) * 110ms);
}
.apps-js .apps-reveal.is-waiting {
    opacity: 0;
    transform: translateY(18px);
}

@media (prefers-reduced-motion: reduce) {
    .apps-js .apps-reveal,
    .apps-js .apps-reveal.is-waiting,
    .app-cta, .app-cta::after, .app-cta:active {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
