/*
 * Public home: page base, shared controls (buttons, segments, selects, range, chips) and helpers.
 * Colours, type and spacing come from the design system tokens.
 *
 * Breakpoints: wide (>= 1100px) shows the filters column; the hero splits in two from 900px;
 * phones (< 700px) get the compact header and the row cards.
 */

:root {
    --home-gutter: 40px;
    --home-header-height: 72px;
    --home-ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --home-ease-sheet: cubic-bezier(0.2, 0.9, 0.25, 1);
    --home-ink: #0a0a0a;
    --home-page: #f6f6f4;
    --home-line: #e6e6e2;
    --home-line-soft: #ebebe7;
    --home-hover: #ececea;
    --home-mute-on-ink: #bdbdb8;
    --home-glass-dark: rgb(10 10 10 / 70%);
    --home-glass-light: rgb(255 255 255 / 12%);
    --home-glass-light-strong: rgb(255 255 255 / 16%);
    --home-line-dark: rgb(255 255 255 / 16%);
    --home-backdrop: rgb(10 10 10 / 50%);
    --home-card-shadow: 0 18px 40px rgb(0 0 0 / 8%);
    --home-pop-shadow: 0 24px 60px rgb(0 0 0 / 18%);
    --home-hero-text-soft: #d4d4d0;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: calc(var(--home-header-height) + 24px);
}

body.home-page {
    margin: 0;
    background: var(--home-page);
    color: var(--rg-color-ink);
    font-family: var(--rg-font-family);
    font-weight: var(--rg-font-weight-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:where(.home-page) a {
    color: inherit;
    text-decoration: none;
}

:where(.home-page) :where(button, input, select) {
    font: inherit;
    color: inherit;
}

:where(.home-page) img {
    display: block;
    max-width: 100%;
}

:where(.home-page) :where(ul, ol) {
    margin: 0;
    padding: 0;
    list-style: none;
}

:where(.home-page) fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.home-page :focus-visible {
    outline: 2px solid var(--rg-color-brand);
    outline-offset: 2px;
}

.home-icons {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

.home-icon {
    width: 1.15em;
    height: 1.15em;
    flex-shrink: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Buttons */
.home-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--rg-space-2);
    height: 48px;
    padding: 0 var(--rg-space-6);
    border: 0;
    border-radius: var(--rg-radius-pill);
    background: var(--home-ink);
    font-size: var(--rg-font-size-base);
    font-weight: var(--rg-font-weight-medium);
    cursor: pointer;
    transition: background var(--rg-transition), transform var(--rg-transition);
}

.home-page .home-button {
    color: var(--rg-color-inverse-text);
}

.home-button:hover {
    background: var(--rg-color-ink-soft);
}

.home-button:active {
    transform: scale(0.98);
}

.home-page .home-button--ghost {
    background: var(--rg-color-surface);
    color: var(--rg-color-ink);
    box-shadow: inset 0 0 0 1px var(--rg-color-line-strong);
}

.home-button--ghost:hover {
    background: var(--rg-color-surface-sunken);
}

.home-round-button {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: var(--rg-color-surface);
    color: var(--rg-color-ink);
    font-size: var(--rg-font-size-2xl);
    cursor: pointer;
}

/* "Quick registration" button (cards, header card, rail) */
.home-quick-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 44px;
    padding: 0 var(--rg-space-2);
    border-radius: var(--rg-radius-pill);
    background: var(--home-ink);
    font-size: var(--rg-font-size-md);
    font-weight: var(--rg-font-weight-medium);
    white-space: nowrap;
    transition: background var(--rg-transition);
}

.home-page .home-quick-button {
    color: var(--rg-color-inverse-text);
}

.home-quick-button:hover {
    background: var(--rg-color-brand);
}

.home-quick-button .home-icon {
    font-size: 15px;
    fill: currentColor;
    stroke-width: 0;
}

.home-page .home-quick-button--off {
    background: var(--rg-color-surface-sunken);
    color: var(--rg-color-ink-muted);
    font-weight: var(--rg-font-weight-regular);
    white-space: normal;
    text-align: center;
    line-height: 1.2;
}

.home-quick-button--off:hover {
    background: var(--rg-color-surface-sunken);
}

/* Segmented control: sort and date ranges */
.home-segment {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    padding: var(--rg-space-1);
    border-radius: var(--rg-radius-md);
    background: var(--rg-color-surface);
    box-shadow: inset 0 0 0 1px var(--home-line);
}

.home-segment__option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    padding: 0 var(--rg-space-3);
    border-radius: var(--rg-radius-sm);
    color: var(--rg-color-ink-muted);
    font-size: var(--rg-font-size-sm);
    white-space: nowrap;
    transition: background var(--rg-transition), color var(--rg-transition);
}

.home-segment__option:hover {
    color: var(--rg-color-ink);
}

.home-page .home-segment__option.is-active {
    background: var(--home-ink);
    color: var(--rg-color-inverse-text);
}

/* Select dressed as a field: the native select covers it, so the platform picker opens */
.home-select {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--rg-space-2);
    height: 46px;
    padding: 0 14px;
    border-radius: var(--rg-radius-md);
    background: var(--rg-color-surface);
    box-shadow: inset 0 0 0 1px var(--home-line);
    color: var(--rg-color-ink);
    font-size: var(--rg-font-size-base);
}

.home-select > .home-icon {
    font-size: 17px;
    color: var(--rg-color-ink-muted);
}

.home-page .home-select.is-active {
    background: var(--home-ink);
    color: var(--rg-color-inverse-text);
}

.home-select.is-active > .home-icon {
    color: inherit;
}

.home-select__field {
    flex: 1;
    min-width: 0;
    height: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: inherit;
    cursor: pointer;
    appearance: none;
}

.home-select__field:focus-visible {
    outline: none;
}

.home-select:focus-within {
    outline: 2px solid var(--rg-color-brand);
    outline-offset: 2px;
}

.home-select__field option {
    color: var(--rg-color-ink);
}

.home-select__chevron {
    pointer-events: none;
}

/* Price range */
.home-range {
    width: 100%;
    margin: 0;
    accent-color: var(--home-ink);
    cursor: pointer;
}

/* Removable filter chips */
.home-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.home-chip {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 var(--rg-space-2) 0 14px;
    border-radius: var(--rg-radius-pill);
    background: var(--rg-color-surface);
    font-size: var(--rg-font-size-md);
    white-space: nowrap;
}

.home-chip .home-icon {
    font-size: 16px;
    color: var(--rg-color-text-muted);
}

.home-page .home-chip--clear {
    padding: 0 var(--rg-space-3);
    background: transparent;
    color: var(--rg-color-brand);
}

@keyframes home-fade-up {
    from {
        opacity: 0;
        transform: translate3d(0, 18px, 0);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes home-rise {
    from {
        transform: translate3d(0, 18px, 0);
    }

    to {
        transform: none;
    }
}

@media (max-width: 1099px) {
    :root {
        --home-gutter: 24px;
    }
}

@media (max-width: 699px) {
    :root {
        --home-gutter: 16px;
        --home-header-height: 122px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
