/* home.css
 *
 * Styling for the public home page (index.php). Everything that used to live in
 * three inline <style> blocks in that file is here instead.
 *
 * The visual language follows the city landing pages (city-pages.css): the
 * tokens already declared in colors.css, hairline-bordered cards on white, and
 * brand orange used as an accent rather than as a fill. No new palette, no new
 * type scale, no framework.
 */

:root {
    /* --color-primary (#F38651) is 2.4:1 on white. That is fine behind a button
     * or as a border, but not for the small brand-coloured text on this page.
     * This shade is 5.0:1 — the same one the city pages use for the same
     * reason. */
    --home-brand-text: #b0552f;
}

/* One rule for consistent typography across all index sections. */
#index-sections,
#index-sections * {
    font-family: var(--font-family-title, inherit) !important;
}

/* --------------------------------------------------------------------------
 * Background cogwheel
 * -------------------------------------------------------------------------- */

.cogwheel-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    overflow-x: hidden;
    /* keep vertical stuff if needed */
    overflow-y: visible;
    pointer-events: none;
    z-index: -1;
}

#cogwheel {
    position: absolute;
    top: -35vw;
    left: -35vw;
    width: 80vw;
    height: 80vw;
    /* Soft background effect, behind the content. */
    z-index: -1;
    animation: rotate 30s linear infinite;
}

@keyframes rotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    #cogwheel {
        animation: none;
    }
}

/* --------------------------------------------------------------------------
 * Hero
 *
 * One block, not the two display:none variants this page used to carry. The
 * duplicated markup meant the same headline and subline existed twice — two
 * <h1> elements in the document, and two places to keep the copy in sync. The
 * desktop and mobile layouts differ only in direction and alignment, which is
 * what flex-wrap and one media query are for.
 * -------------------------------------------------------------------------- */

.content-wrapper {
    padding: 0 5em;
    max-width: 1600px;
    margin: auto;
}

@media (min-width: 1600px) {
    .content-wrapper {
        padding: 0 3em;
    }
}

@media (min-width: 1920px) {
    .content-wrapper {
        padding: 0 2em;
    }
}

.hero {
    padding: 6.5em 0 2.5rem;
    margin-bottom: clamp(2rem, 5vw, 4rem);
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1.5rem, 5vw, 6rem);
}

.hero-copy {
    flex: 1 1 22rem;
    min-width: 0;
    max-width: 34rem;
}

.hero h1 {
    margin: 0 0 0.6rem;
    font-size: clamp(1.86rem, 4.5vw, 2.5rem);
    line-height: 1.15;
}

.hero-sub {
    max-width: 34ch;
    margin: 0 0 1.35rem;
    font-size: clamp(1.05rem, 2.5vw, 1.25rem);
    line-height: 1.5;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1em;
}

.station-counter {
    margin: 0;
    line-height: 1.35;
}

.hero-art {
    flex: 1 1 24rem;
    min-width: 0;
    display: flex;
    justify-content: center;
    margin-top: clamp(1.25rem, 3vw, 3rem);
}

.hero-art img {
    width: 100%;
    max-width: 760px;
    height: auto;
}

@media (max-width: 768px) {
    .content-wrapper {
        padding: 0 1rem;
    }

    .hero {
        padding-top: 5.5em;
    }

    .hero-inner {
        flex-direction: column;
        text-align: center;
    }

    .hero-copy {
        max-width: 100%;
    }

    .hero-sub {
        max-width: 40ch;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions {
        justify-content: center;
    }

    .hero-art img {
        width: 100%;
        max-width: 460px;
    }
}

.digit {
    display: inline-block;
    width: 16px;
    height: 24px;
    overflow: hidden;
    font-weight: bold;
    font-size: 1.2em;
    line-height: 24px;
    text-align: center;
    position: relative;
    background-color: var(--color-primary);
    color: var(--color-text);
    border-radius: 3px;
    margin: 0 0.5px;
    /* Aligns the digits with the words either side of them. */
    vertical-align: middle;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.digit-inner {
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.2s ease-in-out;
}

mark {
    margin: 0 -0.4em;
    padding: 0.1em 0.4em;
    border-radius: 0.8em 0.3em;
    background: linear-gradient(to right,
            rgba(255, 189, 89, 0.1),
            rgba(255, 189, 89, 0.73) 7%,
            rgba(255, 189, 89, 0.15));
    color: var(--color-text);
    -webkit-box-decoration-break: clone;
    box-decoration-break: clone;
}

/* Adjust the cogwheel for smaller screens. */
@media (max-width: 768px) {
    #cogwheel {
        top: -60vw;
        left: -70vw;
        width: 150vw;
        height: 150vw;
    }
}

/* --------------------------------------------------------------------------
 * Sections
 *
 * The site-wide .container is a centred, wrapping flex row with a gap. As a
 * column that layout adds stray space between children, so reset the inherited
 * row behaviour — the same fix .city-container makes — and let the margins do
 * the spacing.
 * -------------------------------------------------------------------------- */

.home-section {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0;
    max-width: 1100px;
    margin: 0 auto 3.25rem;
    padding: 0 1rem;
}

.home-section > * {
    min-width: 0;
    max-width: 100%;
}

.home-kicker {
    margin: 0 0 0.3rem;
    color: var(--home-brand-text);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.home-section h2 {
    margin: 0 0 0.65rem;
    font-size: clamp(1.35rem, 3vw, 1.9rem);
    line-height: 1.2;
}

.home-intro {
    max-width: 68ch;
    margin: 0 0 1.75rem;
    color: #4a4a4a;
    line-height: 1.65;
}

.home-section-footnote {
    margin: 1.25rem 0 0;
    color: var(--color-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}

.home-section-footnote a {
    color: var(--home-brand-text);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
 * Buttons — the same component as .city-button
 * -------------------------------------------------------------------------- */

.home-button {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 0.5em 1em;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-3);
    background: transparent;
    color: var(--color-text);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.home-button:hover,
.home-button:focus-visible {
    border-color: var(--color-primary);
    color: var(--color-text);
    text-decoration: none;
}

.home-button--primary {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #000;
}

.home-button--primary:hover,
.home-button--primary:focus-visible {
    background: var(--color-primary-600);
    border-color: var(--color-primary-600);
    color: #000;
}

/* --------------------------------------------------------------------------
 * Feature cards — the three named features
 * -------------------------------------------------------------------------- */

.home-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1rem;
}

.home-feature {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-2);
    background: var(--color-bg);
    transition: border-color 0.2s ease;
}

.home-feature:hover,
.home-feature:focus-within {
    border-color: var(--color-primary);
}

.home-feature-head {
    display: flex;
    align-items: flex-start;
    gap: 0.7rem;
    margin-bottom: 0.85rem;
}

.home-feature-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: var(--border-radius-3);
    background: rgba(var(--rgb-primary), 0.12);
    color: var(--home-brand-text);
}

.home-feature-icon svg {
    width: 1.35rem;
    height: 1.35rem;
}

.home-feature-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.4rem 0.5rem;
    min-width: 0;
}

.home-feature-name {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.25;
}

.home-feature-tagline {
    flex: 0 0 100%;
    margin: 0.15rem 0 0;
    color: var(--color-muted);
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Same box as the .pro-badge on the station and city pages. */
.home-badge {
    flex-shrink: 0;
    padding: 2px 6px;
    border: 1px solid var(--color-primary);
    border-radius: 6px;
    color: var(--home-brand-text);
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.home-feature-promise {
    margin: 0 0 0.6rem;
    font-size: 1.02rem;
    font-weight: 600;
    line-height: 1.5;
}

.home-feature-blurb {
    margin: 0 0 1.1rem;
    color: #4a4a4a;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Pushes the call to action to the bottom, so three cards of different copy
 * length still line their buttons up. */
.home-feature-cta {
    margin-top: auto;
}

/* --------------------------------------------------------------------------
 * Plans
 * -------------------------------------------------------------------------- */

.home-plans {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.home-plan {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-2);
    background: var(--color-bg);
}

/* The plan the visitor is already on, marked so the page does not try to sell
 * something they have. No plan is styled as "most popular" — that would be a
 * claim this page cannot back up. */
.home-plan.is-current {
    border-color: var(--color-primary);
    background: rgba(var(--rgb-primary), 0.05);
}

.home-plan-name {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.2;
}

.home-plan-audience {
    margin: 0.2rem 0 0.9rem;
    color: var(--color-muted);
    font-size: 0.9rem;
}

.home-plan-price {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1.1;
}

.home-plan-period {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--color-muted);
}

.home-plan-price-note {
    margin: 0.35rem 0 1rem;
    color: var(--color-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

.home-plan-perks {
    list-style: none;
    margin: 0 0 1.25rem;
    padding: 0;
}

.home-plan-perks li {
    position: relative;
    padding-left: 1.35rem;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.home-plan-perks li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: var(--color-primary);
}

.home-plan-cta {
    margin-top: auto;
}

.home-plan-current-label {
    margin: auto 0 0;
    padding: 0.5em 0;
    color: var(--home-brand-text);
    font-size: 0.95rem;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
 * Why-us strip
 * -------------------------------------------------------------------------- */

.home-insights {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
}

.home-insight {
    padding: 1rem 1.1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-3);
    background: var(--color-surface);
}

.home-insight h3 {
    margin: 0 0 0.35rem;
    font-size: 1.02rem;
    font-weight: 700;
}

.home-insight p {
    margin: 0;
    color: #4a4a4a;
    font-size: 0.95rem;
    line-height: 1.55;
}

/* --------------------------------------------------------------------------
 * Search-intent section
 * -------------------------------------------------------------------------- */

.home-seo-block + .home-seo-block {
    margin-top: 2rem;
}

.home-seo-block h3 {
    margin: 0 0 0.6rem;
    font-size: 1.15rem;
    padding-bottom: 0.35rem;
    border-bottom: 1px solid rgba(var(--rgb-primary), 0.28);
}

.home-seo-lead {
    max-width: 72ch;
    margin: 0 0 1rem;
    color: #4a4a4a;
    line-height: 1.65;
}

.home-seo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0.85rem;
}

.home-seo-item {
    padding: 0.95rem 1.05rem;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-3);
    background: var(--color-bg);
}

.home-seo-item h4 {
    margin: 0 0 0.4rem;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
}

.home-seo-item p {
    margin: 0;
    color: #4a4a4a;
    font-size: 0.95rem;
    line-height: 1.55;
}

.home-seo-item a {
    color: var(--home-brand-text);
    font-weight: 600;
}

/* --------------------------------------------------------------------------
 * FAQ accordion
 * -------------------------------------------------------------------------- */

.home-faq-card {
    padding: 0.25rem 0 0.75rem;
}

.faq {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #e4d7be;
}

.faq::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0%;
    height: 2px;
    background-color: var(--color-primary);
    transition: width 0.25s ease-in-out;
}

.faq.active::after {
    width: 100%;
}

.faq-question {
    margin: 0.4rem 0 0;
    font-size: 1.02rem;
    font-weight: 700;
    line-height: 1.4;
}

.faq-toggle {
    position: relative;
    display: block;
    width: 100%;
    padding: 0.85rem 1.6rem 0.85rem 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.faq-toggle::after {
    content: '+';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.45rem;
    color: var(--home-brand-text);
}

.faq.active .faq-toggle::after {
    content: '-';
}

.faq p {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.35s ease;
    margin: 0;
    color: #4a4a4a;
    padding-right: 1rem;
}

.faq.active p {
    max-height: 520px;
    opacity: 1;
    padding-bottom: 0.85rem;
}

/* --------------------------------------------------------------------------
 * Utilities
 * -------------------------------------------------------------------------- */

#index-sections a:focus-visible,
#index-sections button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

@media (max-width: 400px) {
    .home-section {
        padding: 0 0.85rem;
    }

    .home-feature,
    .home-plan {
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-feature,
    .home-button,
    .faq::after,
    .faq p {
        transition: none;
    }
}
