.home-shell {
    background: var(--color-page-background);
    /* Local motion duration for the restrained hover/entrance effects below;
       kept separate from the sitewide --motion-fast (140ms) so this page's
       "settling" feel stays slightly slower without touching shared components. */
    --home-motion: 220ms;
}

/* Motion: a couple of very restrained keyframes reused by the hero entrance,
   the background drift and the "Sobre os dados" reveal below. Kept slow and
   small on purpose -- see @media (prefers-reduced-motion: reduce) at the
   bottom of this file, which switches all of it off. */
@keyframes home-rise-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes home-fade-up {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes home-drift {
    from { transform: translateY(0); }
    to { transform: translateY(14px); }
}

.home-shell .site-header {
    position: absolute;
    inset: 0 0 auto;
    border-bottom-color: rgba(32, 54, 42, .18);
    background: rgba(245, 240, 228, .72);
    backdrop-filter: blur(12px) saturate(.8);
}

.home-shell .home-page {
    overflow: hidden;
    background: var(--color-page-background);
}

/* Hero: the illustration is the full-bleed backdrop; a left-to-right cream veil
   (not a card) carries the copy and fades out so the right side keeps its detail.
   The copy itself sits in the shared .container, so it shares the header logo's left edge. */
.home-shell .home-hero {
    --hero-veil: 248, 245, 237;
    /* Left edge of the shared .container. Percentages resolve against the gradient line, i.e. the full hero width. */
    --copy-x: max(20px, calc((100% - var(--container)) / 2));
    position: relative;
    display: grid;
    min-height: clamp(580px, 82vh, 840px);
    align-items: center;
    overflow: hidden;
    padding: 132px 0 84px;
    isolation: isolate;
}

.home-hero-media,
.home-hero-media::after {
    position: absolute;
    inset: 0;
}

.home-hero-media { z-index: -2; }

/* hero-campus-1907.jpg/webp/avif are already cropped to the building, mat-free.
   The image is still oversized slightly and re-centred (object-position: 50% 50%)
   at each breakpoint below purely to control zoom level and give the scroll-drift
   animation room to move; it is no longer panning toward any particular feature. */
.home-hero-media img {
    position: absolute;
    top: -11%;
    left: -2%;
    width: 104%;
    height: 122%;
    object-fit: cover;
    object-position: 50% 50%;
}

/* Desktop art direction: the source image is now pre-cropped and centred on the
   domed hall, so object-position stays at 50% 50% throughout -- only the amount
   of oversize (zoom) changes per breakpoint. Widths/heights below are still tuned
   by eye at 1280, 1440, 1920 and 2560px. */
@media (min-width: 1280px) {
    .home-hero-media img { top: 0%; left: 0%; width: 100%; height: 100%; object-position: 50% 50%; }
}

@media (min-width: 1440px) {
    .home-hero-media img { top: 0%; left: 0%; width: 100%; height: 100%; object-position: 50% 50%; }
}

@media (min-width: 1920px) {
    .home-hero-media img { top: 0%; left: 0%; width: 100%; height: 100%; object-position: 50% 50%; }
}

@media (min-width: 2560px) {
    .home-hero-media img { top: 0%; left: 0%; width: 104%; height: 100%; object-position: 50% 50%; }
}

.home-hero-media::after {
    z-index: 1;
    /* Two layers: the 90deg one is the reading veil (left-to-right, anchored to
       the copy so it still tracks --copy-x at every width); the 180deg one only
       seams the image into the page background at the very bottom edge. That
       seam layer used to fade in from 86% of the hero's height across its full
       width, which stacked on top of the reading veil and re-greyed the
       centre-right and lower-right corner well after the reading veil itself
       had already cleared -- the actual source of the "washed out" look, more
       than the reading veil's own curve. It's now a short blend confined to
       the last ~12% of the height, and the reading veil itself fades sooner
       and faster past the copy so more of the illustration's colour and
       contrast survives through the centre and right. */
    background:
        linear-gradient(180deg,
            transparent 88%,
            rgba(var(--hero-veil), .22) 95%,
            var(--color-page-background) 100%),
        linear-gradient(90deg,
            rgba(var(--hero-veil), .96) 0%,
            rgba(var(--hero-veil), .88) calc(var(--copy-x) + 220px),
            rgba(var(--hero-veil), .60) calc(var(--copy-x) + 400px),
            rgba(var(--hero-veil), .28) calc(var(--copy-x) + 560px),
            rgba(var(--hero-veil), .08) calc(var(--copy-x) + 700px),
            rgba(var(--hero-veil), 0) calc(var(--copy-x) + 820px));
    content: "";
}

/* Very slow background drift: the illustration lags a few pixels behind the
   page as it scrolls, so it reads as "anchored" while the content above it
   scrolls normally -- a mild differential between foreground and background.
   Native scroll-driven animation, no JS; browsers without support simply
   keep the image still. Disabled on small screens below. */
@supports (animation-timeline: scroll()) {
    .home-hero-media img {
        animation: home-drift 1s linear both;
        animation-timeline: scroll(root);
        animation-range: 0 40vh;
        will-change: transform;
    }
}

.home-shell .home-hero h1 {
    margin: 0 0 clamp(28px, 3vw, 40px);
    color: var(--color-brand);
    font-size: clamp(2.4rem, 1.1rem + 3.6vw, 4.5rem);
    letter-spacing: -.028em;
    line-height: 1.04;
}

.home-hero-line {
    display: block;
    animation: home-rise-in 640ms var(--motion-ease) both;
}

.home-hero-line:nth-of-type(2) { animation-delay: 90ms; }

.home-hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 28px;
    animation: home-fade-up 640ms var(--motion-ease) both;
    animation-delay: 200ms;
}

.home-hero-actions .button-primary {
    min-height: 50px;
    padding-inline: 22px;
    font-size: .95rem;
    box-shadow: 0 10px 22px rgba(23, 96, 60, .2);
}

/* Secondary action: a quiet text link (specificity beats design-system.css, which loads later). */
.home-hero-actions .home-hero-secondary {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--color-brand);
    font-size: .95rem;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-decoration-color: rgba(23, 96, 60, .4);
    text-underline-offset: 6px;
    transition: color var(--motion-fast) var(--motion-ease), text-decoration-color var(--motion-fast) var(--motion-ease);
}

.home-hero-actions .home-hero-secondary:hover {
    color: var(--color-accent);
    text-decoration-color: currentColor;
}

.home-hero-secondary .inline-icon { transition: transform var(--motion-fast) var(--motion-ease); }
.home-hero-secondary:hover .inline-icon { transform: translateX(3px); }

/* Image attribution: small, secondary, aligned with the page's left edge along the bottom of the hero. */
.home-hero-credit {
    position: absolute;
    inset-inline: 0;
    bottom: 14px;
    z-index: 1;
    margin: 0 auto;
    color: var(--color-text-supporting);
    font-size: .72rem;
    letter-spacing: .01em;
    line-height: 1.4;
}

.home-hero-credit a {
    color: inherit;
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--motion-fast) var(--motion-ease);
}

.home-hero-credit a:hover { color: var(--color-accent); }

/* Sections below the hero */
.home-section { padding: clamp(40px, 5vw, 64px) 0; }

.home-shell .home-section-title {
    margin: 0;
    font-size: var(--section-title-size);
    line-height: 1.15;
}

.home-action-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin-top: clamp(20px, 2.4vw, 28px);
}

.home-action-card {
    display: grid;
    grid-template-columns: 1fr auto;
    min-height: 200px;
    padding: 24px 26px;
    border: 1px solid var(--color-border-emphasis);
    border-top: 4px solid var(--color-brand);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    color: inherit;
    text-decoration: none;
    /* Faint resting shadow so the card already reads as sitting slightly
       above the page before it is touched. */
    box-shadow: 0 1px 3px rgba(41, 70, 58, .05);
    transition: transform var(--home-motion) var(--motion-ease), box-shadow var(--home-motion) var(--motion-ease), border-color var(--home-motion) var(--motion-ease);
}

.home-action-card:hover,
.home-action-card:focus-visible {
    border-color: var(--color-accent);
    box-shadow: 0 14px 30px rgba(41, 70, 58, .12);
    transform: translateY(-3px);
}

.home-action-card:focus-visible {
    outline: 3px solid var(--color-focus-ring);
    outline-offset: 4px;
}

.home-card-number {
    grid-column: 1 / -1;
    align-self: start;
    color: var(--color-accent);
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 800;
}

.home-card-copy { display: grid; gap: 10px; align-self: end; }

.home-card-copy strong {
    color: var(--color-brand);
    font-family: var(--font-display);
    font-size: 1.45rem;
    line-height: 1.15;
}

.home-card-copy span {
    color: var(--color-text-supporting);
    font-size: .94rem;
    line-height: 1.55;
}

.home-card-arrow {
    align-self: end;
    margin-left: 18px;
    color: var(--color-accent);
    font-size: 1.35rem;
}

.home-card-arrow .inline-icon { transition: transform var(--home-motion) var(--motion-ease); }
.home-action-card:hover .home-card-arrow .inline-icon,
.home-action-card:focus-visible .home-card-arrow .inline-icon { transform: translateX(3px); }

/* "Sobre os dados": deliberately quiet and compact, subordinate to the hero and the cards. */
.home-about { padding-top: 0; }

.home-about-inner {
    display: grid;
    justify-items: start;
    gap: 10px;
    padding-top: clamp(26px, 3.2vw, 36px);
    border-top: 1px solid var(--color-border);
}

/* Content quietly settles into place as it enters the viewport. Native
   scroll-driven animation, no JS; unsupported browsers just show it still. */
@supports (animation-timeline: view()) {
    .home-about-inner {
        animation: home-fade-up 1s var(--motion-ease) both;
        animation-timeline: view();
        animation-range: entry 0% entry 40%;
    }
}

.home-shell .home-about .home-section-title { font-size: 1.25rem; }

.home-about p {
    max-width: 640px;
    margin: 0;
    color: var(--color-text-supporting);
    font-size: .95rem;
    line-height: 1.6;
}

.home-about .text-link {
    padding-block: 4px;
    font-size: .92rem;
}

/* Narrower desktops and tablets: the copy takes a larger share of the width, so the veil stays opaque further across. */
@media (max-width: 1180px) {
    .home-hero-media::after {
        background:
            linear-gradient(180deg, transparent 86%, var(--color-page-background) 100%),
            linear-gradient(90deg,
                rgba(var(--hero-veil), .98) 0%,
                rgba(var(--hero-veil), .95) 40%,
                rgba(var(--hero-veil), .8) 52%,
                rgba(var(--hero-veil), .4) 63%,
                rgba(var(--hero-veil), .12) 74%,
                rgba(var(--hero-veil), 0) 86%);
    }
}

@media (max-width: 960px) {
    .home-shell .home-hero { min-height: clamp(540px, 66vh, 700px); }

    .home-action-grid { grid-template-columns: 1fr; gap: 14px; }
    .home-action-card { min-height: 0; row-gap: 14px; padding: 20px 22px; }
}

@media (max-width: 700px) {
    .home-shell .site-header { background: rgba(245, 240, 228, .86); }

    /* Small screens: copy sits below the illustration and the veil runs top-to-bottom, stronger for readability. */
    .home-shell .home-hero {
        min-height: min(720px, 82svh);
        padding: 92px 0 56px;
        align-items: end;
    }

    /* The desktop crop (above) is horizontally framed and pans right toward the tower;
       on phone widths the hero box is much taller relative to its width, so object-fit:cover
       becomes height-driven and object-position's vertical component has no slack to act on.
       Inheriting the desktop top/left/width/height here pushed the source window down past the
       main white-domed building entirely, leaving only hazy sky/background visible. This block
       instead gives mobile its own explicit box geometry: a taller, left-anchored window that
       keeps the domed building (plus surrounding campus trees and rooftops) in the upper portion
       of the hero, clear of the bottom veil where the headline and CTAs sit. */
    .home-hero-media img {
        top: -24%;
        left: 0%;
        width: 100%;
        height: 100%;
        object-position: 50% 50%;
        animation: none;
    }

    /* Rebalanced to match the repositioned crop: the building now sits roughly in the
       12%-39% band of the hero height, so opacity stays low through ~32% to keep it clearly
       visible, then ramps to fully opaque by ~70% to protect the bottom-aligned headline/CTAs. */
    .home-hero-media::after {
        background: linear-gradient(180deg,
            rgba(var(--hero-veil), 0) 0%,
            rgba(var(--hero-veil), .08) 32%,
            rgba(var(--hero-veil), .78) 56%,
            rgba(var(--hero-veil), .95) 70%,
            var(--color-page-background) 100%);
    }

    .home-shell .home-hero h1 { font-size: clamp(2.3rem, 10.5vw, 3.4rem); }

    .home-hero-actions { align-items: stretch; flex-direction: column; gap: 4px; }
    .home-hero-actions .button-primary { width: 100%; }
    .home-hero-actions .home-hero-secondary { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .home-action-card,
    .home-hero-actions .home-hero-secondary,
    .home-hero-secondary .inline-icon,
    .home-card-arrow .inline-icon,
    .home-hero-credit a { transition: none; }

    .home-action-card:hover,
    .home-action-card:focus-visible,
    .home-action-card:hover .home-card-arrow .inline-icon,
    .home-action-card:focus-visible .home-card-arrow .inline-icon { transform: none; }

    .home-hero-line,
    .home-hero-actions,
    .home-hero-media img,
    .home-about-inner { animation: none; }
}
