/* Guest landing page (Pages/Index.cshtml) — Figma "SimRacingHub — шаблоны соцсетей":
   Home 1920 (64:3926), 1440 (66:5704), Tablet 768 (66:6275), Mobile 375 (66:7111).
   Loaded only by that page. Fonts, cream/ink/gradient tokens and the header/footer live in
   guest-shell.css. Sections: hero · game band · leaderboard · events · app. */

.home-v2 {
    /* Cancel .app-main's own padding so every section runs edge to edge. */
    margin: calc(-32px / var(--gz, 1)) calc(-40px / var(--gz, 1));
    zoom: var(--gz, 1); /* large screens: see guest-shell.css */
    overflow-x: clip;
    font-family: var(--g-mono);
    color: #000;
}

@media (max-width: 900px) {
    .home-v2 { margin: -20px; zoom: 1; }
}

.home-v2 a { text-decoration: none; }

/* ---------- shared pieces ---------- */

.home-title {
    margin: 0;
    font-family: var(--g-display);
    font-size: 64px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    color: #000; /* theme.css colours every heading light */
}

.home-grad {
    background: var(--g-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.home-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.4;
}

.home-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 26px;
    border: 1px solid transparent;
    font-family: var(--g-mono);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.1px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: filter 150ms ease, border-color 150ms ease, color 150ms ease;
}

.home-btn--grad { background: var(--g-gradient); color: var(--g-cream); }
.home-btn--grad:hover { color: var(--g-cream); filter: brightness(1.08); }

.home-btn--line { border-color: rgba(0, 0, 0, 0.2); color: var(--g-ink); text-transform: none; }
.home-btn--line:hover { color: #fd5e37; border-color: #fd5e37; }

.home-btn:focus-visible,
.home-ev-row:focus-visible { outline: 2px solid #fd5e37; outline-offset: 3px; }

/* ---------- hero ---------- */

.home-hero {
    position: relative;
    isolation: isolate;
    container-type: inline-size;
    display: flex;
    flex-direction: column;
    gap: 31px;
    min-height: 836px;
    padding: 64px 20px 0;
    background: var(--g-cream);
}

/* The livery photo: the whole hero on desktop, a strip along the bottom below that. */
.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: url("../img/home-hero.jpg") center bottom / cover no-repeat;
}

/* The wordmark is set in the display face and sized so it spans the container exactly:
   "SIMRACINGHUB" is 10.16 em wide in Radiotechnika. */
.home-wordmark {
    margin: 0;
    font-family: var(--g-display);
    font-size: calc(100cqw / 10.17);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.2px;
    text-transform: uppercase;
    white-space: nowrap;
    color: #000;
}

.home-hero-row {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 20px;
}

.home-hero-lead {
    grid-column: 1 / span 4;
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

.home-hero-actions {
    grid-column: 9 / span 4;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.home-hero-actions .home-btn { flex: 1 1 0; min-width: 0; }

@media (max-width: 1023px) {
    .home-hero {
        gap: 0;
        min-height: 0;
        padding: 180px 20px calc(53.8vw + 12px);
    }

    .home-hero::before {
        top: auto;
        height: 53.8vw;
    }

    .home-hero-row { display: flex; flex-direction: column; gap: 32px; margin-top: 48px; }
    .home-hero-lead { grid-column: auto; }
    .home-hero-actions { flex-direction: column; gap: 12px; align-self: stretch; }
    .home-hero-actions .home-btn { flex: none; width: 100%; }
}

@media (max-width: 600px) {
    .home-hero { padding: 80px 20px calc(49vw - 28px); }
    .home-hero::before { height: 49vw; }
}

/* ---------- game band (a tilted black strip over the hero's bottom edge) ---------- */

.home-band {
    position: relative;
    z-index: 5;
    height: 0;
}

/* The strip is tilted 3.25° around its centre, so its top edge drops by ~2.84% of the
   page width at the right edge (tan 3.25° ≈ 0.0568, half the width). With a fixed `top`
   that edge slipped below the hero on wide screens, phones and ~1000 px — a small empty
   triangle under the car. --band-lift grows the strip upwards by exactly what is missing
   (+6 px of overlap). The text stays centred in the taller strip: padding its top by the
   lift instead (as first done) left more black above the text than below it on wide screens. */
.home-band-strip {
    --band-lift: max(0px, calc(2.84vw - 43px));
    position: absolute;
    left: -30%;
    right: -30%;
    top: calc(-49px - var(--band-lift)); /* the strip is centred just under the hero edge, as in the frames */
    height: calc(116px + var(--band-lift));
    display: flex;
    align-items: center;
    overflow: hidden;
    background: #000;
    border-bottom: 1px solid #333;
    transform: rotate(3.25deg);
}

.home-band-track {
    display: flex;
    flex: none;
    gap: 20px;
    padding-left: 20px;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-transform: uppercase;
    color: #dedede;
    animation: home-band 70s linear infinite;
}

.home-band-track i { font-style: normal; color: var(--g-orange); }

@keyframes home-band { to { transform: translateX(-50%); } }

@media (prefers-reduced-motion: reduce) {
    .home-band-track { animation: none; }
}

@media (max-width: 1023px) {
    .home-band-strip {
        --band-lift: max(0px, calc(2.84vw - 19px));
        top: calc(-25px - var(--band-lift));
    }
}

@media (max-width: 600px) {
    .home-band-strip {
        --band-lift: max(0px, 2.84vw);
        top: calc(-6px - var(--band-lift));
        height: calc(97px + var(--band-lift));
    }
}

/* ---------- leaderboard ---------- */

.home-lb {
    display: flex;
    gap: 40px;
    padding: 140px 20px;
    background: var(--g-cream);
}

.home-lb-intro {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: none;
    width: 590px;
    max-width: 100%;
}

.home-lb-intro-body { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }

.home-lb-card {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    height: 555px;
    overflow: hidden;
    border: 1px solid #c0c0c0;
    /* The whole card — rows and outline — dissolves into the page towards the bottom. */
    -webkit-mask-image: linear-gradient(to bottom, #000 38%, rgba(0, 0, 0, 0) 100%);
    mask-image: linear-gradient(to bottom, #000 38%, rgba(0, 0, 0, 0) 100%);
}

.home-lb-head,
.home-lb-row {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr) 200px;
    align-items: center;
}

.home-lb-head {
    height: 48px;
    border-bottom: 1px solid #c0c0c0;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #aaa;
}

.home-lb-head span { padding: 0 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-lb-head span:first-child { text-align: center; }
.home-lb-head span:last-child { padding: 0 24px; text-align: right; }

.home-lb-row {
    height: 110px;
    border-bottom: 1px solid #c0c0c0;
    font-family: Arial, Helvetica, sans-serif;
    text-transform: uppercase;
}

.home-lb-rank {
    padding-left: 8px;
    text-align: center;
    font-size: 20px;
    color: #606060;
}

.home-lb-pilot {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
    padding: 0 8px;
}

.home-lb-pilot img { flex: none; width: 48px; height: 48px; object-fit: contain; }

.home-lb-who { display: flex; flex-direction: column; gap: 6px; min-width: 0; }

.home-lb-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 20px;
    letter-spacing: 0.8px;
    color: #000;
}

.home-lb-car {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-family: var(--g-mono);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #aaa;
}

.home-lb-time { display: flex; flex-direction: column; gap: 4px; padding: 0 24px; text-align: right; }
.home-lb-time b { font-weight: 400; font-size: 20px; letter-spacing: 0.8px; color: #000; font-variant-numeric: tabular-nums; }
.home-lb-time small { font-size: 12px; color: #aaa; font-variant-numeric: tabular-nums; }

/* Until there are enough laps for a preview the card carries what the table does instead. */
.home-lb-points { margin: 0; padding: 0; list-style: none; }
.home-lb-points li { padding: 28px 24px; border-bottom: 1px solid #c0c0c0; }
.home-lb-points b { display: block; margin-bottom: 8px; font-family: var(--g-display); font-size: 20px; font-weight: 400; letter-spacing: 0.4px; text-transform: uppercase; }
.home-lb-points span { font-size: 14px; line-height: 1.4; color: #606060; }

@media (max-width: 1023px) {
    .home-lb { flex-direction: column; gap: 40px; padding: 140px 20px 120px; }
    .home-lb-intro { width: auto; align-items: stretch; }
    .home-lb-intro .home-title { text-align: center; }
    .home-lb-intro-body { align-items: center; text-align: center; }
    .home-lb-card { flex: none; height: 508px; }
}

@media (max-width: 600px) {
    .home-title { font-size: 32px; }
    .home-lb { padding: 120px 20px 100px; }
    .home-lb-head, .home-lb-row { grid-template-columns: 52px minmax(0, 1fr) auto; }
    .home-lb-row { height: 92px; }
    .home-lb-pilot { gap: 10px; padding: 0 6px; }
    .home-lb-pilot img { width: 36px; height: 36px; }
    .home-lb-name { font-size: 15px; letter-spacing: 0.4px; }
    .home-lb-car { font-size: 10px; letter-spacing: 1px; }
    .home-lb-time { padding: 0 12px 0 6px; }
    .home-lb-time b { font-size: 15px; letter-spacing: 0.4px; }
    .home-lb-head span:last-child { padding: 0 12px 0 6px; }
}

/* ---------- events ---------- */

.home-ev {
    display: flex;
    flex-direction: column;
    gap: 80px;
    padding: 120px 20px 80px;
    background: #000;
    color: var(--g-cream);
}

.home-ev-head {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.home-ev-head .home-title { grid-column: span 2; color: var(--g-cream); }

.home-ev-side { display: flex; flex-direction: column; align-items: flex-start; gap: 20px; }

.home-ev-list { display: flex; flex-direction: column; }

.home-ev-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 160px;
    margin-bottom: -1px;
    padding: 32px 40px;
    border-top: 1px solid var(--g-hairline);
    border-bottom: 1px solid var(--g-hairline);
    box-shadow: 0 4px 78.3px rgba(1, 76, 142, 0.07);
    color: var(--g-cream);
    transition: background-color 150ms ease;
}

.home-ev-row:hover { color: var(--g-cream); background: rgba(255, 255, 255, 0.03); }

.home-ev-when { display: flex; align-items: center; gap: 26px; flex: none; }

.home-ev-day { font-family: var(--g-display); font-size: 36px; line-height: 1; letter-spacing: 0.2px; }

.home-ev-month { display: flex; flex-direction: column; gap: 6px; }
.home-ev-month b { font-weight: 400; font-size: 20px; color: #e6e8eb; }
.home-ev-month small { font-size: 12px; text-transform: uppercase; color: #8a8a8a; }

.home-ev-what { display: flex; flex-direction: column; gap: 14px; width: 400px; min-width: 0; }
.home-ev-kind { font-family: "JetBrains Mono", var(--g-mono); font-size: 12px; font-weight: 500; text-transform: uppercase; color: #fd5e37; }
.home-ev-track { font-family: var(--g-display); font-size: 24px; line-height: 1.1; text-transform: uppercase; color: #e6e8eb; overflow-wrap: anywhere; }

.home-ev-game { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.home-ev-game b { font-weight: 400; font-size: 20px; color: #e6e8eb; }
.home-ev-game small { font-size: 16px; color: rgba(230, 232, 235, 0.62); }

.home-ev-go {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    height: 53px;
    padding: 0 24px;
    border: 1px solid #37383c;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.56px;
    text-transform: uppercase;
    white-space: nowrap;
    color: #f5f9fc;
}

.home-ev-row:hover .home-ev-go { border-color: #fd5e37; }

.home-ev-empty {
    padding: 56px 40px;
    border-top: 1px solid var(--g-hairline);
    border-bottom: 1px solid var(--g-hairline);
    color: rgba(230, 232, 235, 0.62);
    font-size: 16px;
    line-height: 1.4;
}

@media (max-width: 1279px) {
    .home-ev-row { gap: 16px; }
    .home-ev-what { width: 260px; }
}

@media (max-width: 1023px) {
    .home-ev-head { display: flex; flex-direction: column; gap: 20px; align-items: center; text-align: center; }
    .home-ev-side { align-items: center; }

    .home-ev-row {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas: "when what" "game game";
        column-gap: 48px;
        row-gap: 32px;
        align-items: center;
        padding: 49px 40px;
    }

    .home-ev-when { grid-area: when; }
    .home-ev-what { grid-area: what; width: auto; }
    .home-ev-game { grid-area: game; }
    .home-ev-go { display: none; }
}

@media (max-width: 600px) {
    .home-ev { gap: 60px; }
    .home-ev-row {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 32px;
        padding: 49px 0;
        box-shadow: none;
    }
    .home-ev-empty { padding: 40px 0; }
}

/* ---------- app ---------- */

.home-app {
    display: flex;
    gap: 40px;
    padding: 120px 20px;
    background: var(--g-cream);
}

.home-app-intro {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: none;
    width: 590px;
    max-width: 100%;
}

.home-app-intro-body { display: flex; flex-direction: column; align-items: flex-start; gap: 24px; }

.home-app-version { font-size: 12px; color: #606060; font-variant-numeric: tabular-nums; }

.home-app-panel-wrap { position: relative; flex: 1 1 0; min-width: 0; }

.home-app-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 598px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid #c0c0c0;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.03);
}

.home-app-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.13);
    font-family: "JetBrains Mono", var(--g-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 1.32px;
    text-transform: uppercase;
}

.home-app-live { display: flex; align-items: center; gap: 10px; color: #fd5e37; white-space: nowrap; }
.home-app-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fd5e37; box-shadow: 0 0 0 4px rgba(253, 94, 55, 0.18); }
.home-app-where { color: #7b8893; text-align: right; }

.home-app-body { display: flex; gap: 20px; align-items: flex-start; }

.home-app-map { flex: none; width: 230px; height: 220px; }
.home-app-map img { display: block; width: 100%; height: 100%; }

.home-app-readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; flex: 1 1 0; min-width: 0; }

.home-app-readout {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    overflow: hidden;
    border: 1px solid #c0c0c0;
    border-radius: 3px;
}

.home-app-readout span { font-family: "JetBrains Mono", var(--g-mono); font-size: 11px; font-weight: 500; letter-spacing: 1.32px; text-transform: uppercase; color: #7b8893; }
.home-app-readout b { font-family: "JetBrains Mono", var(--g-mono); font-size: 18px; line-height: 1; color: #000; }
.home-app-readout--delta b { color: #4caf6d; }

.home-app-laps { border-top: 1px solid #c0c0c0; font-family: "JetBrains Mono", var(--g-mono); font-size: 13px; font-weight: 500; }

.home-app-lap {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #c0c0c0;
    color: #7b8893;
}

.home-app-lap span:first-child { width: 44px; flex: none; }
.home-app-lap span:nth-child(2) { flex: 1 1 0; min-width: 0; }
.home-app-lap b { font-weight: 700; color: #000; font-variant-numeric: tabular-nums; }
.home-app-lap--best b { color: #fd5e37; }

.home-app-fade {
    position: absolute;
    inset: auto 0 0 0;
    height: 62%;
    pointer-events: none;
    background: linear-gradient(to top, var(--g-cream) 4%, rgba(239, 238, 235, 0));
}

@media (max-width: 1023px) {
    .home-app { flex-direction: column; gap: 40px; }
    .home-app-intro { width: auto; align-items: stretch; }
    .home-app-intro .home-title { text-align: center; }
    .home-app-intro-body { align-items: center; text-align: center; }
    .home-app-panel { height: 565px; }
}

@media (max-width: 600px) {
    .home-app { padding: 120px 20px 80px; }
    .home-app-panel { height: 300px; padding: 16px; gap: 14px; }
    .home-app-body { gap: 12px; }
    .home-app-map { width: 110px; height: 105px; }
    .home-app-readouts { gap: 8px; }
    .home-app-readout { padding: 8px 10px; }
    .home-app-readout span { font-size: 9px; letter-spacing: 0.8px; }
    .home-app-readout b { font-size: 14px; }
    .home-app-where { display: none; }
}
