/* =========================================================
   Herd Genetics — homepage
   ========================================================= */

/* ---------- Hero header ---------- */

.hero {
    position: relative;
    height: clamp(440px, 72vh, 640px);
    overflow: hidden;
    background-color: var(--background-b);
}

/* Vignette + fade into the dark strip below */
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse at center, rgba(29, 51, 40, 0.15) 0%, rgba(29, 51, 40, 0.6) 100%),
        linear-gradient(to bottom, transparent 55%, var(--background-b) 100%);
    pointer-events: none;
}

/* Banner strip. js/marquee.js copies the images once and scrolls the strip
   left in a seamless loop at a constant speed. Without JS it stays still.
   The width/height attributes on each <img> fix its size before it loads,
   so the strip never changes length while it moves. */
.marquee {
    position: relative;
    width: max-content;
    height: 100%;
    filter: brightness(58%) saturate(90%);
    will-change: transform;
}

/* Override base.css `img { max-width: 100% }`, which would squeeze
   every banner into one screen width and leave nothing to scroll. */
.marquee > * {
    display: block;
    flex-shrink: 0;
    width: auto;
    max-width: none;
    height: 100%;
    object-fit: cover;
}

.header-text {
    position: absolute;
    left: 50%;
    top: 50%;
    translate: -50% -50%;
    z-index: 1;
    width: min(92%, 780px);
    color: var(--text-b);
    text-shadow: 0 2px 18px rgba(0, 0, 0, 0.45);
}

.hero-eyebrow {
    margin: 0 0 14px;
    font-size: clamp(0.8rem, 0.75rem + 0.3vw, 0.95rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.24em;
    color: var(--accent);
}

.header-text h1 {
    margin: 0;
    font-size: clamp(2.6rem, 1.6rem + 4.5vw, 5rem);
    letter-spacing: -0.02em;
}

/* Wheat title rule on the dark hero */
.header-text h1::after {
    background-color: var(--accent);
}

.hero-lead {
    max-width: 56ch;
    margin: 20px auto 0;
    font-size: clamp(1rem, 0.92rem + 0.45vw, 1.2rem);
    line-height: 1.6;
    opacity: 0.94;
}

.hero-actions {
    justify-content: center;
    margin-top: 28px;
    text-shadow: none;
}

.hero-actions .as-btn {
    padding: 12px 24px;
}

/* Outline button for use on the dark hero */
.hero-ghost {
    color: var(--text-b);
    border: 1px solid rgba(248, 246, 239, 0.6);
    background-color: rgba(29, 51, 40, 0.35);
}

.hero-ghost:hover {
    background-color: rgba(29, 51, 40, 0.7);
    border-color: var(--text-b);
}

/* ---------- Dark strip of quick links under the hero ---------- */

.quicklinks > .as-link {
    padding: 14px 10px !important;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: background-color var(--transition);
}

.quicklinks > .as-link + .as-link {
    border-left: 1px solid var(--dark-soft);
}

.quicklinks > .as-link:hover {
    background-color: var(--green);
}

/* ---------- Class dashboard ---------- */

.classsection {
    width: min(var(--content-width), 100%);
    margin-inline: auto;
    padding: 36px 20px 0;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 14px 20px;
    margin-bottom: 22px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--outlines);
}

.section-head h2 {
    margin: 0;
    font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem);
}

/* Responsive grid of cards */
.classlist {
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)) !important;
    align-items: stretch;
    gap: 22px;
}

/* Still wrapper: it takes the hover, the card inside it moves.
   (A card that moves on its own :hover jitters at its edges.) */
.class-slot {
    display: flex;
    flex-direction: column;
}

.class {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    overflow: hidden;
    background-color: var(--surface);
    border: 1px solid var(--outlines);
    transition: box-shadow var(--transition), transform var(--transition);
}

.class-slot:hover > .class {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.toprow {
    border-bottom: 3px solid var(--accent);
}

.toprow a {
    padding: 18px 20px;
    text-decoration: none;
    transition: background-color var(--transition);
}

.toprow a:hover {
    background-color: var(--dark-soft);
}

.toprow h3 {
    margin: 0;
    font-size: 1.35rem;
}

.toprow p {
    margin: 6px 0 0;
    font-size: 0.9rem;
    opacity: 0.75;
    overflow-wrap: anywhere;
}

/* Info on top, assignments underneath, "Open class" pinned to the bottom */
.classinfo {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.classinfo > .pad {
    padding: 16px 20px 6px;
    color: var(--muted);
}

.classinfo > .pad:empty {
    display: none;
}

.assignment-heading {
    margin: 12px 20px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted);
}

.assignment-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0 20px 6px;
    list-style: none;
}

.assignment-list li {
    display: grid;
    gap: 2px;
    padding: 9px 12px;
    line-height: 1.35;
    background-color: var(--green-tint);
    border-left: 3px solid var(--green);
    border-radius: 0 var(--radius-small) var(--radius-small) 0;
}

.assignment-title {
    font-size: 0.95rem;
    font-weight: 600;
}

.assignment-dates {
    font-size: 0.85rem;
    color: var(--muted);
}

.class-open {
    margin: auto 20px 0;
    padding: 14px 0 18px;
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--green-dark);
}

.class-open:hover {
    text-decoration: underline;
}

/* Pending class requests */
.pending-head {
    padding: 16px 20px;
    border-bottom: 3px solid var(--gold);
}

.pending-head h3 {
    margin: 4px 0 0;
    font-family: var(--font-mono);
    font-size: 1.15rem;
    overflow-wrap: anywhere;
}

.pending-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}

.class-pending > .pad {
    flex: 1;
    padding: 16px 20px;
    color: var(--gold-dark);
    background-color: var(--gold-tint);
}

/* ---------- "How it works" (logged-out visitors) ---------- */

.features {
    width: min(var(--content-width), 100%);
    margin-inline: auto;
    padding: 52px 20px 10px;
}

.features h2 {
    margin: 0 0 32px;
    font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.2rem);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
    gap: 22px;
}

.feature {
    padding: 26px 24px 22px;
    background-color: var(--surface);
    border: 1px solid var(--outlines);
    border-top: 4px solid var(--green);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.feature h3 {
    margin: 14px 0 8px;
}

.feature p {
    margin: 0;
    color: var(--muted);
}

.feature-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    font-family: var(--font-serif);
    font-weight: 700;
    color: var(--text-b);
    background-color: var(--background-b);
    border-radius: 50%;
}

.features-actions {
    justify-content: center;
    margin-top: 32px;
}

/* ---------- Small screens ---------- */

@media (max-width: 600px) {
    .quicklinks > .as-link {
        font-size: 0.88rem;
    }

    .section-head {
        align-items: flex-start;
    }
}
