/*
 * static/css/home.css — the home (landing) page, #home-screen (plan R-110, lane home; it moved here from layout.css).
 *
 * Ray (2026-11-13): no "Silicon Valley · Purdue EPICS" bubble; the title through the call to action on the left, the
 * portrait with its description on the right ("a left-right style instead of just everything being centered and
 * scrolling down"), with room for a tasteful overhaul. As built, in the app's "gold on graphite, ink on ivory"
 * (docs/plan/specs/ui-overhaul.md §3, §10):
 * - the mountain photograph (--brand-home-image, the -narrow copy at 800 px and below: layout.css) under a veil that
 *   is heaviest behind the words on the left and lets the hills through on the right, fading into the canvas at the
 *   foot, where the footer row sits (the tagline and, R-118, the "Privacy policy" link);
 * - left: the display-serif title with its gold name, the two subtitles (the second set off by a gold rule) and the
 *   primary pill;
 * - right: a frosted card: the portrait in its gold ring beside the label (the name in gold again), a hairline, then
 *   the description;
 * - one desktop screen (1512x945, 1440x900, 1280x800) holds it all without scrolling; at 900 px and below the card
 *   stacks under the button, and phones keep 16 px gutters;
 * - a short rise-and-fade entrance (hero first, then the card), off under prefers-reduced-motion.
 * Tokens only (tokens.css and the profile's theme.css), so both themes follow; every selector is defined once (I7).
 * Pinned by tests/js/home.test.mjs and tests/browser/app/test_home.py.
 */

#home-screen {
    /* the veil's strength over the photograph: behind the words, mid-way, over the open hills */
    --home-veil-a: 88%;
    --home-veil-b: 70%;
    --home-veil-c: 38%;
    display: flex; flex-direction: column; width: 100%; height: 100vh; height: 100dvh;
    padding: 76px clamp(24px, 5vw, 80px) 22px; position: relative; overflow-y: auto; overflow-x: hidden; isolation: isolate;
    background:
        var(--grain),
        linear-gradient(90deg,
            color-mix(in srgb, var(--c-bg) var(--home-veil-a), transparent) 0%,
            color-mix(in srgb, var(--c-bg) var(--home-veil-b), transparent) 48%,
            color-mix(in srgb, var(--c-bg) var(--home-veil-c), transparent) 100%),
        linear-gradient(180deg, color-mix(in srgb, var(--c-bg) 24%, transparent) 0%, transparent 26%, transparent 58%, var(--c-bg) 100%),
        var(--brand-home-image-fit, var(--brand-home-image)) center 38% / cover no-repeat,
        var(--c-bg);
}
[data-theme="light"] #home-screen { --home-veil-a: 93%; --home-veil-b: 80%; --home-veil-c: 50%; }

/* The theme toggle: a frosted round button in the top right corner (like the sign-in page's pills). */
.home-theme-toggle { position: absolute; top: 20px; right: 20px; z-index: 1; }
#home-screen .home-theme-toggle { background: color-mix(in srgb, var(--c-surface) 72%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
#home-screen .home-theme-toggle:hover { background: color-mix(in srgb, var(--c-surface-high) 88%, transparent); }

/* Two columns, centred in the screen above the tagline. */
.home-panel {
    flex: none; width: 100%; max-width: 1200px; margin: auto;
    display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); grid-template-areas: "hero card";
    align-items: center; column-gap: clamp(40px, 6vw, 96px); row-gap: var(--space-8);
}

/* Left: the title through the call to action. */
.home-hero { grid-area: hero; display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-5); min-width: 0; }
.home-title {
    max-width: 11em; font: 500 clamp(2.6rem, 1.2rem + 3.6vw, 4.6rem) / 1.04 var(--font-display);
    letter-spacing: -0.015em; color: var(--c-on); text-wrap: balance;
}
.home-title .home-accent-word { color: var(--c-accent-text); }
.home-subtitle {
    max-width: 34em; margin-top: var(--space-1); color: var(--c-on); text-wrap: pretty;
    font: var(--t-body-l); font-size: clamp(1.0625rem, 0.95rem + 0.3vw, 1.1875rem); line-height: 1.6;
}
/* the Purdue EPICS line, set off by a short gold rule */
.home-subtitle-secondary {
    max-width: 38em; padding-left: var(--space-4); border-left: 2px solid var(--c-accent);
    color: var(--c-on-2); font: var(--t-body-l); line-height: 1.65; text-wrap: pretty;
}
/* The primary call to action: gold with a black label in dark, ink with an ivory label and gold accents in light.
   A minimum height, not a fixed one: on a 320 px phone the words wrap onto two balanced lines and the pill grows. */
.home-cta {
    display: inline-flex; align-items: center; gap: 10px; max-width: 100%; min-height: 56px; margin-top: var(--space-3);
    padding: 10px 28px 10px 30px; border: 0; border-radius: var(--radius-pill); background: var(--c-primary); color: var(--c-on-primary);
    box-shadow: inset 0 0 0 1px var(--c-primary-edge); font: var(--t-label-l); font-size: 1rem; text-align: center; text-wrap: balance; cursor: pointer;
    transition: background-color var(--dur-1) var(--ease-standard), box-shadow var(--dur-1) var(--ease-standard);
}
.home-cta:hover { background: var(--c-primary-hover); box-shadow: inset 0 0 0 1px var(--c-primary-edge), var(--elev-1); }
.home-cta .home-cta-arrow { font-size: 1.15rem; line-height: 1; color: var(--c-on-primary-accent); transition: transform var(--dur-2) var(--ease-standard); }
.home-cta:hover .home-cta-arrow { transform: translateX(4px); }

/* Right: the portrait card (the portrait beside its label, a hairline, the description). */
.home-portrait-section {
    grid-area: card; min-width: 0; position: relative; isolation: isolate;
    display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "portrait label" "desc desc";
    align-items: center; column-gap: var(--space-5); row-gap: var(--space-6);
    padding: 36px var(--space-8) var(--space-8); border-radius: 28px;
    background: color-mix(in srgb, var(--c-surface) 80%, transparent);
    box-shadow: inset 0 0 0 1px var(--c-outline-variant), var(--elev-2);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    animation: home-rise 600ms var(--ease-enter) 120ms both;   /* after the hero (below) */
}
.home-portrait {
    grid-area: portrait; width: 128px; height: 128px; object-fit: cover; object-position: center;
    border-radius: 50%; border: 2px solid var(--c-brand); padding: 3px; background: var(--c-bg);
}
.home-portrait-label {
    grid-area: label; min-width: 0; color: var(--c-on); text-wrap: balance;
    font: 500 clamp(1.5rem, 1.1rem + 0.9vw, 2.125rem) / 1.12 var(--font-display); letter-spacing: -0.01em;
}
.home-portrait-label .home-accent-word { color: var(--c-accent-text); }
.home-portrait-desc {
    grid-area: desc; padding-top: var(--space-6); border-top: 1px solid var(--c-outline-variant);
    color: var(--c-on-2); font: var(--t-body-m); font-size: 0.9375rem; line-height: 1.7; text-wrap: pretty;
}
/* The corner sprig: the profile's --brand-home-sprig, a mask drawn in --c-motif under the card's words, anchored at
   its top-right corner (it runs off the rounded corner). js/ui/corner-art.js measures the room the title leaves and
   sets the box (--home-sprig-w x --home-sprig-h; 0 until measured and where nothing fits) and the drawing's height
   (--home-sprig-art: at most the portrait's row, less in a narrow room); the drawing fades out at the box's left and
   lower edges (those gradients are masks too: only their alpha counts), so it never reaches the title, the portrait
   or the hairline. The drawing is the last (lowest) mask layer: WebKit composites a layer only where it paints, so a
   drawing on top that ends short of the box let the fades show through below it. */
.home-portrait-section::before {
    content: ''; position: absolute; top: 0; right: 0; z-index: -1; pointer-events: none;
    width: var(--home-sprig-w, 0px); height: var(--home-sprig-h, 0px);
    border-top-right-radius: inherit;
    background: var(--c-motif);
    -webkit-mask:
        linear-gradient(to left, black calc(100% - 36px), transparent),
        linear-gradient(black calc(100% - 24px), transparent),
        var(--brand-home-sprig) right top / auto var(--home-sprig-art, 0px) no-repeat;
    -webkit-mask-composite: source-in;
    mask:
        linear-gradient(to left, black calc(100% - 36px), transparent),
        linear-gradient(black calc(100% - 24px), transparent),
        var(--brand-home-sprig) right top / auto var(--home-sprig-art, 0px) no-repeat;
    mask-composite: intersect;
}

/* The footer row under both columns (R-118, privacy.md §5.4): the tagline, then the "Privacy policy" link (a new tab),
   on one line, wrapping only where the width runs out. The link is small, muted and underlined; a fork without the
   site.json label shows none. */
.home-footer {
    flex: none; margin-top: var(--space-6);
    display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: var(--space-5); row-gap: var(--space-1);
}
.home-tagline { text-align: center; color: var(--c-on-3); font: var(--t-body-s); }
.home-privacy {
    color: var(--c-on-3); font: var(--t-body-s); text-decoration: underline; text-underline-offset: 3px;
    text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); border-radius: var(--radius-xs);
}
.home-privacy:hover { color: var(--c-on-2); text-decoration-color: currentColor; }
.home-privacy:empty { display: none; }

/* Entrance: the hero rises in line by line, then the card (its rule above; calm motion, §4.7). */
@keyframes home-rise { from { opacity: 0; transform: translateY(12px); } }
.home-hero > * { animation: home-rise var(--dur-5) var(--ease-enter) both; }
.home-hero > :nth-child(2) { animation-delay: 50ms; }
.home-hero > :nth-child(3) { animation-delay: 100ms; }
.home-hero > :nth-child(4) { animation-delay: 150ms; }

/* At 900 px and below the card stacks under the call to action; the veil runs top to bottom. */
@media (max-width: 900px) {
    #home-screen {
        padding: 76px var(--space-6) var(--space-5);
        background:
            var(--grain),
            linear-gradient(180deg,
                color-mix(in srgb, var(--c-bg) var(--home-veil-b), transparent) 0%,
                color-mix(in srgb, var(--c-bg) var(--home-veil-a), transparent) 45%,
                var(--c-bg) 100%),
            var(--brand-home-image-fit, var(--brand-home-image)) center 38% / cover no-repeat,
            var(--c-bg);
    }
    .home-panel { max-width: 640px; grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "card"; }
}
@media (max-width: 560px) {
    #home-screen { padding: 72px var(--space-4) var(--space-4); }
    .home-panel { row-gap: var(--space-7); }
    .home-hero { gap: var(--space-4); }
    .home-cta { min-height: 52px; padding: 10px 22px 10px 24px; }
    .home-portrait-section { column-gap: var(--space-4); row-gap: var(--space-5); padding: var(--space-5) var(--space-5) var(--space-6); border-radius: var(--radius-xl); }
    .home-portrait { width: 88px; height: 88px; }
    .home-portrait-desc { padding-top: var(--space-5); }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero > *, .home-portrait-section { animation: none; }
}

/* Forced colours: no sprig. */
@media (forced-colors: active) {
    .home-portrait-section::before { display: none; }
}
