/* Amla season: the orchard's year, with today's place in it. */
#amla-season {
    --as-ground: #1c2519;
    --as-ivory: #f4f1e6;
    --as-muted: #a3ab96;
    --as-rule: rgba(244, 241, 230, .17);
    --as-fruit: #d2da82;
    background: var(--as-ground);
    color: var(--as-ivory);
    font-family: var(--font-sans);
    scroll-margin-top: var(--as-nav);
    overflow: hidden;

    /* The whole section is sized to sit inside one screen, below the nav. */
    --as-vh: 100vh;
    --as-nav: 76px;
    --as-side: clamp(27px, 5vw, 56px);
    --as-pad-top: clamp(36px, calc(var(--as-vh) * .07), 104px);
    --as-pad-bottom: clamp(28px, calc(var(--as-vh) * .05), 72px);
    --as-year-gap: clamp(28px, calc(var(--as-vh) * .055), 88px);
    --as-stage-h: calc(var(--as-vh) - var(--as-nav) - var(--as-pad-top) - var(--as-pad-bottom) - var(--as-year-gap) - 91px);
}

@supports (height: 100svh) {
    #amla-season { --as-vh: 100svh; }
}

#amla-season .as-inner {
    max-width: 1240px;
    margin: 0 auto;
    box-sizing: border-box;
    padding: var(--as-pad-top) var(--as-side) var(--as-pad-bottom);
}

#amla-season .as-stage {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(40px, 6vw, 96px);
    align-items: center;
}

#amla-season .as-title {
    margin: 0 0 clamp(16px, calc(var(--as-vh) * .036), 38px);
    font-family: var(--font-display);
    font-size: clamp(46px, min(6.4vw, calc(var(--as-vh) * .1)), 92px);
    font-weight: 400;
    line-height: .98;
    letter-spacing: -.025em;
    color: var(--as-ivory);
    text-wrap: balance;
}

#amla-season .as-story {
    max-width: 440px;
    margin: 0 0 clamp(20px, calc(var(--as-vh) * .042), 44px);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.8;
    color: var(--as-muted);
}

#amla-season .as-link {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 23px;
    min-height: 51px;
    padding: 16px 20px;
    background: var(--as-ivory);
    color: var(--as-ground);
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    text-decoration: none;
    transition: background-color 220ms ease;
}

#amla-season .as-link:hover { background: #fffdf6; }

#amla-season .as-link:focus-visible {
    outline: 2px solid var(--as-ivory);
    outline-offset: 5px;
}

#amla-season .as-arrow {
    display: inline-block;
    font-size: 22px;
    line-height: 1;
    transition: transform 220ms cubic-bezier(.22, 1, .36, 1);
}

#amla-season .as-link:is(:hover, :focus-visible) .as-arrow { transform: translateX(4px); }

/* Media: the living branch beside two stills. */
#amla-season .as-media {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    gap: clamp(10px, 1.2vw, 16px);
    margin: 0;
}

#amla-season .as-branch,
#amla-season .as-photos img {
    display: block;
    width: 100%;
    object-fit: cover;
    background: #273222;
}

#amla-season .as-branch { aspect-ratio: 9 / 16; height: 100%; }

#amla-season .as-photos {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: clamp(10px, 1.2vw, 16px);
    min-height: 0;
}

#amla-season .as-photos img { height: 100%; min-height: 0; }

/* The orchard year runs March to February, flower to harvest. */
#amla-season .as-year {
    position: relative;
    margin-top: var(--as-year-gap);
    padding-top: 34px;
}

#amla-season .as-months,
#amla-season .as-phases {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}

#amla-season .as-months li {
    padding-bottom: 12px;
    font-size: 10px;
    line-height: 1;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: var(--as-muted);
}

#amla-season .as-phases li {
    grid-column: span var(--as-span, 2);
    margin-right: 3px;
    padding-top: 13px;
    border-top: 1px solid var(--as-rule);
    font-family: var(--font-display);
    font-size: 17px;
    line-height: 1.25;
    color: var(--as-muted);
}

#amla-season .as-phases li:last-child { margin-right: 0; }

#amla-season .as-phases li.as-now {
    border-top-color: var(--as-fruit);
    color: var(--as-ivory);
}

#amla-season .as-marker {
    position: absolute;
    top: 34px;
    bottom: 0;
    left: calc(var(--as-pos, 0) * 100%);
    width: 0;
    pointer-events: none;
}

#amla-season .as-marker[hidden] { display: none; }

#amla-season .as-marker::before {
    content: "";
    position: absolute;
    top: -8px;
    height: 30px;
    left: 0;
    border-left: 1px solid var(--as-fruit);
    opacity: .55;
}

#amla-season .as-marker::after {
    content: "";
    position: absolute;
    top: 17px;
    left: -5.5px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--as-fruit);
    box-shadow: 0 0 0 5px rgba(210, 218, 130, .16);
}

#amla-season .as-today {
    position: absolute;
    bottom: calc(100% + 14px);
    left: 0;
    transform: translateX(-50%);
    font-size: 10px;
    line-height: 1;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--as-fruit);
}

#amla-season .as-marker.as-edge-start .as-today { transform: none; }
#amla-season .as-marker.as-edge-end .as-today { transform: translateX(-100%); }

/* Entrance: only when the script is present to finish it. */
#amla-season.as-js .as-reveal {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 900ms ease, transform 900ms cubic-bezier(.22, 1, .36, 1);
    transition-delay: calc(var(--as-order, 0) * 110ms);
}

#amla-season.as-js.as-in .as-reveal { opacity: 1; transform: none; }

@media (min-width: 901px) {
    #amla-season .as-stage { grid-template-columns: minmax(0, 1fr) auto; }
    #amla-season .as-media { width: max(240px, min(calc((var(--as-stage-h) - 16px) * .9375 + 16px), 45vw, 563px)); }
}

/* Stacked: the media strip takes whatever height the screen has left. */
@media (max-width: 900px) {
    #amla-season .as-inner {
        display: flex;
        flex-direction: column;
        min-height: calc(var(--as-vh) - var(--as-nav));
    }
    #amla-season .as-stage {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
        align-items: stretch;
        gap: clamp(20px, calc(var(--as-vh) * .035), 44px);
    }
    #amla-season .as-copy { flex: none; }
    #amla-season .as-story { max-width: 560px; }
    #amla-season .as-media {
        flex: 1 1 0;
        min-height: 96px;
        max-height: 460px;
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr) minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr);
        gap: 8px;
    }
    #amla-season .as-photos { display: contents; }
    #amla-season .as-branch { aspect-ratio: auto; min-height: 0; }
}

/* Phone: the living branch runs edge to edge with the headline set over it. */
@media (max-width: 600px) {
    #amla-season {
        --as-pad-top: 0px;
        --as-pad-bottom: clamp(22px, calc(var(--as-vh) * .04), 44px);
        --as-year-gap: clamp(22px, calc(var(--as-vh) * .04), 48px);
    }
    #amla-season .as-stage {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) auto auto;
        gap: 0;
    }
    #amla-season .as-copy { display: contents; }
    #amla-season .as-media {
        position: relative;
        display: block;
        grid-area: 1 / 1;
        min-height: 200px;
        max-height: none;
        margin: 0 calc(var(--as-side) * -1);
    }
    #amla-season .as-media::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom,
            rgba(28, 37, 25, 0) 62%, rgba(28, 37, 25, .45) 86%, var(--as-ground) 100%);
        pointer-events: none;
    }
    #amla-season .as-branch {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-position: 50% 62%;
    }
    #amla-season .as-photos { display: none; }
    #amla-season .as-title {
        position: relative;
        z-index: 1;
        grid-area: 1 / 1;
        align-self: end;
        margin: 0;
        padding-bottom: 6px;
        font-size: clamp(42px, 12.6vw, 56px);
        text-shadow: 0 1px 18px rgba(20, 28, 18, .55);
    }
    #amla-season .as-story {
        grid-area: 2 / 1;
        margin: 14px 0 20px;
        font-size: 14px;
        line-height: 1.65;
    }
    #amla-season .as-link {
        grid-area: 3 / 1;
        justify-self: start;
        min-height: 48px;
        padding: 13px 18px;
    }
    #amla-season .as-months li { font-size: 9px; letter-spacing: 0; }
    #amla-season .as-months li span { display: none; }
    #amla-season .as-phases li { min-height: 16px; padding-top: 0; font-size: 0; }
    #amla-season .as-marker::before { height: 29px; }
    #amla-season .as-marker::after { top: 15px; }
}

/* Short phones (iPhone SE with Safari's bars showing). */
@media (max-width: 600px) and (max-height: 600px) {
    #amla-season .as-media { min-height: 132px; }
    #amla-season .as-title { font-size: 38px; }
}

@media (prefers-reduced-motion: reduce) {
    #amla-season .as-link,
    #amla-season .as-arrow { transition: none; }
    #amla-season .as-link:is(:hover, :focus-visible) .as-arrow { transform: none; }
    #amla-season.as-js .as-reveal { transition: none; }
    #amla-season.as-js .as-reveal { opacity: 1; transform: none; }
}
