/* The phone menu of the creative-alliance pages (the homepage, the FAQ and
   the About page), with js/menu.js. It opens over the whole screen from the
   menu button, a circle widening from the button until it is the screen;
   the links large and numbered, rising one after another, the page you are
   on marked; the way to write at its foot. The header stays above it, its
   button turned into a cross. Shown only where the header has its menu
   button (768px and under). */

.ca-menu {
    --ca-x: calc(100% - 44px);
    --ca-y: 40px;
    position: fixed;
    inset: 0;
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: calc(96px + env(safe-area-inset-top)) 24px calc(28px + env(safe-area-inset-bottom));
    overflow-y: auto;
    overscroll-behavior: contain;
    background:
        radial-gradient(90% 50% at 0 100%, rgba(255, 107, 53, 0.14), transparent 70%),
        #0a0a0e;
    color: var(--text-primary);
    clip-path: circle(0 at var(--ca-x) var(--ca-y));
    transition: clip-path 0.75s cubic-bezier(0.7, 0, 0.2, 1);
}

.ca-menu[hidden] { display: none; }
.ca-menu.is-open { clip-path: circle(150vmax at var(--ca-x) var(--ca-y)); }

/* Once open, the circle is let go and the menu's dark reaches far above and
   below the screen, so pulling past either edge on a phone (the rubber
   band) shows more of the same dark and never the page behind. */
.ca-menu.is-settled {
    clip-path: none;
    box-shadow: 0 -100vh 0 0 #0a0a0e, 0 100vh 0 0 #0a0a0e;
}

/* The links: large, numbered, one under the other. */
.ca-menu-links {
    display: flex;
    flex-direction: column;
    margin: 0;
}

.ca-menu-links a {
    display: flex;
    align-items: baseline;
    gap: 16px;
    padding: 10px 0;
    color: var(--text-primary);
    text-decoration: none;
    font-size: clamp(36px, 11vw, 52px);
    font-weight: var(--fw-regular);
    letter-spacing: -0.045em;
    line-height: 1.08;
    opacity: 0;
    transform: translateY(32px);
    transition: opacity 0.5s, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.3s;
}

.ca-menu-links small {
    flex: none;
    width: 1.6em;
    font-size: 15px;
    letter-spacing: 0;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

.ca-menu-links a[aria-current="page"] span { color: var(--accent-orange); }
.ca-menu-links a:active span { color: var(--accent-orange); }

.ca-menu.is-open .ca-menu-links a { opacity: 1; transform: none; }
.ca-menu.is-open .ca-menu-links a:nth-child(1) { transition-delay: 0.22s; }
.ca-menu.is-open .ca-menu-links a:nth-child(2) { transition-delay: 0.28s; }
.ca-menu.is-open .ca-menu-links a:nth-child(3) { transition-delay: 0.34s; }
.ca-menu.is-open .ca-menu-links a:nth-child(4) { transition-delay: 0.4s; }
.ca-menu.is-open .ca-menu-links a:nth-child(5) { transition-delay: 0.46s; }

/* The way to write, at the foot: the email and the button side by side
   on one line, never wrapping one over the other; on a very narrow screen
   the email gives way first. */
.ca-menu-foot {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    opacity: 0;
    transition: opacity 0.6s 0.5s;
}

.ca-menu.is-open .ca-menu-foot { opacity: 1; }

.ca-menu-foot a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.85);
    font-size: 15px;
    text-decoration: none;
}

.ca-menu-foot .ca-menu-cta {
    flex: none;
    padding: 13px 20px;
    border-radius: 99px;
    background: var(--text-primary);
    color: #111;
    font-weight: var(--fw-semibold);
}

.ca-menu a:focus-visible {
    outline: 2px solid var(--accent-orange);
    outline-offset: 4px;
    border-radius: 4px;
}

/* While it is open the header keeps its place above it, its own ground
   gone so it reads as part of the menu, and the page behind does not
   scroll. */
/* The lock is on html alone: on body too it would make body a scrolling
   box of its own, the header would lose its place at the top, and with it
   the cross that closes the menu. */
html.ca-menu-open {
    overflow: hidden;
    overscroll-behavior: none;
}
html.ca-menu-open .main-header .nav-container {
    background: transparent !important;
    border-color: transparent !important;
    box-shadow: none !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
}

/* The button's three lines become a cross: thinner, as the menu's lines. */
.mobile-menu-btn span { height: 1.5px; }

@media (prefers-reduced-motion: reduce) {
    .ca-menu { transition: none; clip-path: none; opacity: 0; }
    .ca-menu.is-open { opacity: 1; }
    .ca-menu-links a,
    .ca-menu-foot { transition: none; transform: none; }
}
