/* =========================================================
   Responsive
   ========================================================= */

@media (max-width: 1280px) {
    .header-inner {
        gap: 24px;
    }

    .primary-nav {
        gap: 22px;
        margin-left: 4px;
    }

    .header-log-cta {
        display: none;
    }

    .hero-inner {
        grid-template-columns: minmax(0, 1fr) 350px;
        gap: 50px;
    }

    .section-head {
        grid-template-columns: minmax(0, 1fr) 320px auto;
        gap: 28px;
    }

    .chat-layout {
        grid-template-columns: 218px minmax(0, 1fr) 252px;
    }
}

@media (max-width: 1120px) {
    .brand-sub {
        font-size: 11px;
    }

    .user-chip-name {
        display: none;
    }

    .chat-layout {
        grid-template-columns: 220px minmax(0, 1fr);
    }

    .chat-rail {
        display: none;
    }

    .logger-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
    }

    .footer-top {
        gap: 40px;
    }
}

@media (max-width: 1024px) {
    .header-inner {
        width: min(100% - 40px, 1340px);
    }

    .brand-sub {
        display: none;
    }

    .primary-nav {
        gap: 18px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 48px;
        min-height: 0;
        padding-top: 78px;
        padding-bottom: 46px;
    }

    .hero-copy {
        max-width: 760px;
    }

    .hero h1 {
        font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    }

    .hero-card {
        justify-self: start;
        width: min(100%, 420px);
        transform: rotate(0);
    }

    .hero-stats {
        grid-template-columns: repeat(4, 1fr);
    }

    .hero-stats-link {
        grid-column: 1 / -1;
        padding-top: 4px;
    }

    .section-head {
        grid-template-columns: minmax(0, 1fr) 300px;
    }

    .section-head .text-link {
        grid-column: 1 / -1;
        justify-self: start;
        margin-top: 2px;
    }

    .feature-grid,
    .legacy-grid {
        grid-template-columns: 1fr;
    }

    .feature-card--chat {
        padding: 34px;
    }

    .logger-mock {
        max-width: 520px;
        margin-inline: auto;
    }

    .legacy-card {
        padding: 30px;
    }

    .cta-panel {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .cta-actions {
        justify-content: flex-start;
    }

    .auth-shell {
        grid-template-columns: 1fr;
    }

    .auth-visual {
        min-height: 390px;
        padding: 42px;
    }

    .auth-quote {
        max-width: 760px;
        font-size: clamp(2.5rem, 6vw, 4.2rem);
    }

    .auth-panel {
        padding: 60px 32px 76px;
    }

    .logger-head-top {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .logger-head-top > p {
        max-width: 580px;
        padding-bottom: 0;
    }

    .logger-stats {
        margin-top: 32px;
    }

    .logger-layout {
        grid-template-columns: 1fr;
    }

    .logger-rail {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }

    .logger-rail .map-card {
        position: static;
        grid-column: 1 / -1;
    }

    .logger-rail .catch-map {
        height: 380px;
    }

    .footer-top {
        grid-template-columns: 1fr;
        gap: 42px;
    }

    .footer-legacy {
        max-width: 640px;
    }

    .footer-links {
        flex-wrap: wrap;
    }

    .footer-motto {
        order: 3;
        width: 100%;
        margin-left: 0;
    }
}

@media (max-width: 900px) {
    .primary-nav,
    .header-actions {
        display: none;
    }

    .nav-toggle {
        display: block;
        margin-left: auto;
    }

    .mobile-nav {
        max-height: calc(100vh - var(--header-h));
        overflow-y: auto;
    }

    .chat-page-head-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .chat-head-meta {
        align-items: flex-start;
    }

    .chat-layout {
        grid-template-columns: 1fr;
    }

    .chat-sidebar {
        display: none;
    }

    .chat-window {
        height: calc(100vh - 210px);
        min-height: 560px;
    }

    .catch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .catch-grid--log {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .logger-stats {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 18px;
    }

    .logger-stats-mine {
        padding-left: 0;
        border-left: 0;
    }
}

@media (max-width: 760px) {
    :root {
        --header-h: 72px;
    }

    .container,
    .header-inner,
    .footer-top,
    .footer-links {
        width: min(100% - clamp(18px, 4vw, 36px), 1260px);
        max-width: 100%;
        box-sizing: border-box;
    }

    .brand img {
        width: 43px;
        height: 43px;
    }

    .brand-name {
        font-size: 1.28rem;
    }

    .hero-inner {
        padding-top: 56px;
    }

    .hero h1 {
        font-size: clamp(1.4rem, 3.2vw, 1.9rem);
    }

    .hero-lede {
        font-size: 13px;
    }

    .hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-actions .button {
        width: 100%;
    }

    .hero-presence {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .hero-card {
        width: 100%;
    }

    .hero-stats {
        grid-template-columns: 1fr 1fr;
        gap: 18px;
    }

    .hero-stats strong {
        font-size: 1.8rem;
    }

    .hero-stats-link {
        grid-column: 1 / -1;
    }

    .section {
        padding: 68px 0;
    }

    .section-head {
        grid-template-columns: 1fr;
        gap: 15px;
        margin-bottom: 30px;
    }

    .section-head > p {
        max-width: 520px;
    }

    .feature-card--chat {
        padding: 27px;
    }

    .feature-card-body {
        padding: 26px;
    }

    .logger-mock {
        margin: 20px 20px 0;
    }

    .legacy {
        padding: 72px 0;
    }

    .legacy-year {
        font-size: 6rem;
    }

    .legacy-quote {
        margin-top: 36px;
        padding-top: 30px;
    }

    .cta-section {
        padding: 64px 0 72px;
    }

    .cta-panel {
        padding: 36px 28px;
    }

    .cta-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .cta-actions .button {
        width: 100%;
    }

    .cta-stamp {
        display: none;
    }

    .auth-visual {
        min-height: 320px;
        padding: 30px;
    }

    .auth-crew-stamps {
        margin-top: 26px;
        padding-top: 18px;
    }

    .auth-panel {
        padding: 46px 22px 64px;
    }

    .auth-panel .field-row,
    .crew-picker {
        grid-template-columns: 1fr;
    }

    .demo-card {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
    }

    .chat-page-head {
        padding: 38px 0 42px;
    }

    .chat-page-head h1 {
        font-size: clamp(3.5rem, 14vw, 5rem);
    }

    .chat-window {
        height: calc(100vh - 190px);
        min-height: 520px;
    }

    .chat-window-head {
        padding-inline: 14px;
    }

    .chat-window-head p {
        display: none;
    }

    .chat-messages {
        padding: 16px 14px 20px;
    }

    .chat-message-body {
        max-width: 86%;
    }

    .chat-composer {
        padding-inline: 10px;
    }

    .chat-composer-hint {
        display: none;
    }

    .chat-composer-note {
        padding-left: 54px;
    }

    .chat-locked {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .logger-head {
        padding-top: 38px;
    }

    .logger-head h1 {
        font-size: clamp(3.8rem, 15vw, 5.6rem);
    }

    .logger-stats {
        grid-template-columns: 1fr 1fr;
    }

    .logger-stats-mine {
        grid-column: 1 / -1;
    }

    .logger-form-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 24px 20px 20px;
    }

    .logger-form-head h2 {
        font-size: 2.6rem;
    }

    .logger-form-card > .form-alert {
        margin-inline: 20px;
    }

    .form-section {
        padding: 23px 20px 25px;
    }

    .field-grid,
    .field-grid--gps {
        grid-template-columns: 1fr;
    }

    .field-grid--gps .field {
        grid-column: auto;
    }

    .gps-box {
        align-items: flex-start;
        flex-direction: column;
    }

    .gps-box .button {
        width: 100%;
    }

    .catch-form-submit {
        align-items: stretch;
        flex-direction: column;
        padding: 20px;
    }

    .catch-form-submit .button {
        width: 100%;
    }

    .logger-locked {
        grid-template-columns: 1fr;
        gap: 24px;
        padding: 24px;
    }

    .logger-locked-art {
        max-width: 190px;
    }

    .logger-rail {
        display: flex;
    }

    .logger-rail .map-card {
        position: static;
    }

    .logger-rail .catch-map {
        height: 320px;
    }

    .recent-catches {
        margin-top: 42px;
    }

    .recent-head {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .log-filters {
        align-items: stretch;
        flex-direction: column;
    }

    .log-filters > input,
    .log-filters > select,
    .log-filter-search {
        flex: none;
        width: 100%;
    }

    .log-filters .button {
        width: 100%;
    }

    .filter-reset {
        align-self: flex-start;
        padding: 3px 0;
    }

    .catch-grid,
    .catch-grid--log,
    .catch-grid--three {
        grid-template-columns: 1fr;
    }

    .footer-top {
        padding-bottom: 36px;
    }

    .footer-brand img {
        width: 52px;
        height: 52px;
    }

    .footer-brand img.footer-logo--custom {
        width: auto;
        height: 52px;
        max-width: 9rem;
    }

    .footer-wordmark {
        font-size: clamp(1.45rem, 6.4vw, 2rem);
    }

    .footer-legacy {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .footer-links {
        align-items: flex-start;
        flex-direction: column;
        gap: 18px;
    }

    .footer-links nav {
        gap: 16px;
    }

    .footer-copy {
        font-size: 11px;
    }

    .flash {
        top: calc(var(--header-h) + 10px);
        right: 12px;
        left: 12px;
        max-width: none;
    }
}

@media (max-width: 520px) {
    .brand-name {
        font-size: 1.08rem;
    }

    .brand img {
        width: 38px;
        height: 38px;
    }

    .hero-eyebrow {
        font-size: 11px;
    }

    .eyebrow-rule,
    .hero-eyebrow > span:nth-last-child(1) {
        display: none;
    }

    .hero h1 {
        font-size: clamp(1.3rem, 4.2vw, 1.6rem);
    }

    .hero-card {
        padding: 10px;
    }

    .hero-catch-weight {
        font-size: 1.2rem;
    }

    .section-head h2 {
        font-size: 2.8rem;
    }

    .mini-chat-row p {
        font-size: 11px;
    }

    .chat-message > .avatar {
        width: 29px;
        height: 29px;
        font-size: 11px;
    }

    .chat-message-body {
        max-width: 90%;
        padding: 8px 10px;
    }

    .chat-message-body > p {
        font-size: 11px;
    }

    .chat-window-head .channel-hash {
        font-size: 18px;
    }

    .chat-window-head h2 {
        font-size: 1.35rem;
    }

    .chat-locked-actions {
        width: 100%;
        flex-direction: column;
    }

    .chat-locked-actions .button {
        width: 100%;
    }

    .logger-form-head,
    .form-section {
        padding-inline: 16px;
    }

    .logger-form-card > .form-alert {
        margin-inline: 16px;
    }

    .auth-quote {
        font-size: 2.2rem;
    }

    .auth-crew-stamps {
        flex-wrap: wrap;
        gap: 10px;
    }

    .auth-crew-stamps i {
        display: none;
    }

    .auth-panel h1 {
        font-size: 3.2rem;
    }

    .catch-detail-info h1 {
        font-size: 3.4rem;
    }

    .catch-detail-actions {
        flex-direction: column;
    }

    .catch-detail-actions .button,
    .catch-detail-actions .kudos-button {
        width: 100%;
        justify-content: center;
    }

    .empty-state {
        padding: 44px 18px;
    }
}

/* ---------------------------------------------------------- one column, always
   Four layouts are drawn as content-plus-sidebar, and none of them had a
   breakpoint: at 390px a 280px sidebar leaves the content column 60px wide, so
   the feed rendered as a stack of 58px cards with the words cut off. They are
   one column below 900px, where a sidebar stops being a sidebar and starts being
   the rest of the page. */

@media (max-width: 900px) {
    .feed-layout,
    .settings-layout,
    .donate-intro,
    .library-columns {
        grid-template-columns: minmax(0, 1fr);
    }
}