@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap");

:root {
    --fhh-ink: #162F41;
    --fhh-blue: #2A84D5;
    --fhh-green: #21AF4F;
    --fhh-mid: #506370;
    --fhh-steel: #8A97A0;
    --fhh-line: #D7E0E5;
    --fhh-line-strong: #C5CBCF;
    --fhh-bg: #F5F8FA;
    --fhh-surface: #FFFFFF;
    --fhh-surface-soft: #EEF3F6;
    --fhh-success-bg: #EAF6EE;
    --fhh-error-bg: #FFF0EE;
    --fhh-error: #B42318;
    --fhh-shadow: 0 18px 40px rgba(22, 47, 65, 0.08);
    --fhh-shadow-soft: 0 12px 30px rgba(22, 47, 65, 0.05);
    --fhh-radius-lg: 24px;
    --fhh-radius: 18px;
    --fhh-radius-sm: 14px;
    --fhh-container: 1180px;
    --fhh-gradient: linear-gradient(135deg, #21AF4F 0%, #2A84D5 100%);
    --fhh-deep-gradient: linear-gradient(135deg, #162F41 0%, #506370 100%);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--fhh-ink);
    background:
        radial-gradient(circle at top right, rgba(42, 132, 213, 0.08), transparent 28%),
        radial-gradient(circle at top left, rgba(33, 175, 79, 0.05), transparent 24%),
        var(--fhh-bg);
    font-family: Roboto, Arial, sans-serif;
    line-height: 1.55;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--fhh-blue);
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--fhh-ink);
}

button,
input,
select,
textarea {
    font: inherit;
}

button {
    cursor: pointer;
}

h1,
h2,
h3,
h4,
p,
ul {
    margin-top: 0;
}

ul {
    padding-left: 1.15rem;
}

.container {
    width: min(var(--fhh-container), calc(100% - 2rem));
    margin-inline: auto;
}

.narrow-shell {
    width: min(860px, 100%);
}

.site-main {
    min-height: calc(100vh - 260px);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(197, 203, 207, 0.65);
}

.site-header__band {
    height: 6px;
    background: var(--fhh-gradient);
}

.header-row {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    min-height: 86px;
}

.brand {
    flex: 0 0 auto;
}

.brand img {
    width: auto;
    height: 58px;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-left: auto;
}

.nav-links,
.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.nav-links a {
    color: var(--fhh-mid);
    font-weight: 700;
    text-decoration: none;
}

.nav-links a.is-active,
.nav-links a:hover {
    color: var(--fhh-ink);
}

.user-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.65rem 0.95rem;
    border-radius: 999px;
    background: var(--fhh-surface-soft);
    border: 1px solid var(--fhh-line);
    font-weight: 700;
}

.user-pill small {
    color: var(--fhh-blue);
    font-weight: 700;
}

.nav-toggle {
    display: none;
    margin-left: auto;
    padding: 0.85rem 1rem;
    border: 1px solid var(--fhh-line);
    border-radius: 999px;
    background: var(--fhh-surface);
    color: var(--fhh-ink);
    font-weight: 700;
}

.notice-stack {
    padding-top: 1rem;
}

.notice {
    padding: 1rem 1.15rem;
    border-radius: var(--fhh-radius-sm);
    border: 1px solid transparent;
    margin-bottom: 0.85rem;
}

.notice strong {
    display: block;
    margin-bottom: 0.45rem;
}

.notice--success {
    background: var(--fhh-success-bg);
    border-color: rgba(33, 175, 79, 0.2);
}

.notice--error {
    background: var(--fhh-error-bg);
    border-color: rgba(180, 35, 24, 0.18);
}

.notice-list {
    margin: 0.5rem 0 0;
}

.hero-section,
.page-section,
.section {
    padding: 3.5rem 0;
}

.section--line {
    border-top: 1px solid rgba(197, 203, 207, 0.7);
    border-bottom: 1px solid rgba(197, 203, 207, 0.7);
    background: rgba(255, 255, 255, 0.35);
}

.section--soft {
    background: linear-gradient(180deg, rgba(238, 243, 246, 0.65) 0%, rgba(255, 255, 255, 0.5) 100%);
    border-top: 1px solid rgba(197, 203, 207, 0.55);
}

.hero-grid,
.auth-shell,
.detail-layout,
.search-layout,
.statement-grid,
.footer-grid {
    display: grid;
    gap: 1.5rem;
}

.hero-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.9fr);
    align-items: start;
}

.hero-copy h1,
.page-header h1,
.detail-header h1,
.auth-aside h1,
.section-heading h1 {
    font-size: clamp(2.35rem, 4vw, 4.2rem);
    line-height: 1.02;
    letter-spacing: -0.04em;
    margin-bottom: 1rem;
}

.page-header h1,
.detail-header h1,
.auth-aside h1,
.section-heading h1 {
    font-size: clamp(2rem, 3vw, 3.2rem);
}

.hero-copy .lead,
.page-header .lead,
.detail-header .lead,
.auth-aside p,
.section-heading p {
    font-size: 1.05rem;
    color: var(--fhh-mid);
    max-width: 64ch;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.8rem;
    color: var(--fhh-mid);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.eyebrow--accent {
    color: var(--fhh-blue);
}

.hero-actions,
.card-actions,
.inline-actions {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
}

.hero-actions {
    margin-top: 1.5rem;
}

.hero-stats,
.feature-grid,
.results-grid {
    display: grid;
    gap: 1rem;
}

.hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 1.6rem;
}

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

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

.results-grid--shortlists {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-rail {
    display: grid;
    gap: 1rem;
}

.card {
    position: relative;
    background: var(--fhh-surface);
    border: 1px solid rgba(197, 203, 207, 0.95);
    border-radius: var(--fhh-radius);
    box-shadow: var(--fhh-shadow-soft);
}

.card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 34%);
}

.hero-search-card,
.auth-aside,
.auth-panel,
.sidebar-card,
.form-card,
.content-card,
.filter-panel,
.shortlist-share {
    padding: 1.4rem;
}

.hero-search-card {
    background:
        url('/images/hex-grid.svg') no-repeat right top / 220px,
        var(--fhh-surface);
}

.panel-note {
    padding: 1.2rem 1.3rem;
}

.panel-note .plain-list {
    margin: 0;
}

.stat-card,
.feature-card,
.shortlist-card {
    padding: 1.2rem;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.35rem;
    color: var(--fhh-ink);
}

.stat-card span,
.feature-card p,
.shortlist-card p {
    color: var(--fhh-mid);
}

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

.statement-card {
    padding: 1.35rem;
}

.statement-card--accent {
    background:
        linear-gradient(180deg, rgba(33, 175, 79, 0.07), rgba(42, 132, 213, 0.08)),
        var(--fhh-surface);
}

.section-heading {
    margin-bottom: 1.4rem;
}

.section-heading--tight {
    margin-bottom: 1rem;
}

.section-heading h2,
.result-card h3,
.shortlist-item h2,
.shortlist-card h2,
.file-card strong,
.content-card h2,
.sidebar-card h2 {
    font-size: 1.45rem;
    line-height: 1.15;
    margin-bottom: 0.55rem;
    letter-spacing: -0.02em;
    color: var(--fhh-ink);
}

.hero-search-card h2,
.auth-panel h2,
.auth-aside h2,
.section-heading h2 {
    font-size: 1.55rem;
}

.muted {
    color: var(--fhh-mid);
}

.page-header,
.detail-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 1.5rem;
    align-items: end;
    margin-bottom: 1.75rem;
}

.page-header--split {
    align-items: start;
}

.page-header__meta {
    min-height: 145px;
    display: grid;
    place-content: center;
    text-align: center;
    padding: 1rem;
    background:
        linear-gradient(180deg, rgba(33, 175, 79, 0.07), rgba(42, 132, 213, 0.1)),
        var(--fhh-surface);
}

.page-header__meta strong {
    display: block;
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.35rem;
}

.search-layout {
    grid-template-columns: minmax(290px, 320px) minmax(0, 1fr);
    align-items: start;
}

.detail-layout {
    grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
    align-items: start;
}

.detail-main,
.results-column,
.detail-sidebar {
    display: grid;
    gap: 1rem;
}

.content-card,
.sidebar-card,
.shortlist-item,
.result-card,
.shortlist-card {
    overflow: hidden;
}

.search-form,
.stack-form,
.copy-panel,
.file-list,
.stack-list {
    display: grid;
    gap: 1rem;
}

.copy-panel {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
}

.field,
.checkbox-group {
    display: grid;
    gap: 0.45rem;
}

.field label,
.field-label,
.checkbox-group p {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--fhh-ink);
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

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

.field--wide {
    grid-column: 1 / -1;
}

.input,
.select,
textarea {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border-radius: 14px;
    border: 1px solid var(--fhh-line);
    background: #fff;
    color: var(--fhh-ink);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input:focus,
.select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(42, 132, 213, 0.65);
    box-shadow: 0 0 0 4px rgba(42, 132, 213, 0.12);
}

textarea {
    resize: vertical;
    min-height: 160px;
}

.checkbox-row {
    display: inline-flex;
    align-items: start;
    gap: 0.65rem;
    color: var(--fhh-mid);
    font-size: 0.95rem;
}

.checkbox-row input {
    margin-top: 0.25rem;
}

.checkbox-grid {
    display: grid;
    gap: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
}

.form-actions--split {
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 0.45rem;
    min-height: 46px;
    padding: 0.78rem 1.1rem;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--fhh-gradient);
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    box-shadow: none;
}

.button:hover {
    color: #fff;
    filter: brightness(0.97);
    text-decoration: none;
}

.button--ghost {
    background: var(--fhh-surface);
    color: var(--fhh-ink);
    border-color: var(--fhh-line);
}

.button--ghost:hover {
    color: var(--fhh-ink);
    background: var(--fhh-surface-soft);
}

.button--secondary {
    background: var(--fhh-ink);
    color: #fff;
}

.button--small {
    min-height: 38px;
    padding: 0.58rem 0.95rem;
    font-size: 0.92rem;
}

.button--disabled {
    opacity: 0.45;
    pointer-events: none;
}

.chip-row,
.active-filter-row {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.tag,
.pill,
.fhh-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.42rem 0.72rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    border: 1px solid rgba(197, 203, 207, 0.95);
    background: var(--fhh-surface-soft);
    color: var(--fhh-ink);
}

.tag--soft {
    background: rgba(42, 132, 213, 0.08);
}

.tag--accent {
    background: rgba(33, 175, 79, 0.12);
}

.metric-row {
    display: flex;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: auto;
    color: var(--fhh-mid);
    font-size: 0.94rem;
}

.result-card,
.shortlist-card {
    display: grid;
    gap: 1rem;
    padding: 1.2rem;
}

.result-card__header,
.shortlist-item {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.shortlist-item {
    padding: 1.2rem 1.25rem;
}

.shortlist-item__content {
    display: grid;
    gap: 0.9rem;
    min-width: 0;
}

.shortlist-item__actions {
    display: grid;
    gap: 0.65rem;
    align-content: start;
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    color: var(--fhh-mid);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.breadcrumbs a {
    color: var(--fhh-mid);
}

.table-wrap,
.fhh-table-wrap {
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.data-table th,
.data-table td {
    padding: 0.85rem 0.95rem;
    text-align: left;
    border-bottom: 1px solid var(--fhh-line);
    vertical-align: top;
}

.data-table th {
    color: var(--fhh-mid);
    font-size: 0.86rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.file-card {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--fhh-line);
    border-radius: var(--fhh-radius-sm);
    background: #fff;
}

.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    border-radius: var(--fhh-radius);
    border: 1px dashed var(--fhh-line-strong);
    background:
        url('/images/hex-grid.svg') no-repeat center top / 220px,
        rgba(255, 255, 255, 0.6);
}

.empty-state h2,
.empty-state h3 {
    margin-bottom: 0.7rem;
}

.pagination-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 1.4rem;
}

.pagination-summary {
    color: var(--fhh-mid);
    font-weight: 700;
}

.mobile-filter-bar {
    display: none;
    margin-bottom: 1rem;
}

.plain-list {
    margin: 0;
    display: grid;
    gap: 0.55rem;
    color: var(--fhh-mid);
}

.auth-shell {
    grid-template-columns: minmax(300px, 0.9fr) minmax(0, 1.1fr);
    align-items: start;
}

.auth-shell--wide {
    grid-template-columns: minmax(300px, 0.85fr) minmax(0, 1.15fr);
}

.auth-aside {
    min-height: 100%;
    background:
        linear-gradient(180deg, rgba(22, 47, 65, 0.98), rgba(80, 99, 112, 0.98)),
        var(--fhh-ink);
    color: #fff;
    overflow: hidden;
}

.auth-aside::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url('/images/hex-grid.svg') no-repeat right bottom / 240px;
    opacity: 0.24;
}

.auth-aside > * {
    position: relative;
    z-index: 1;
}

.auth-aside .eyebrow,
.auth-aside p,
.auth-aside li {
    color: rgba(255, 255, 255, 0.84);
}

.auth-aside h1 {
    color: #fff;
}

.auth-panel--single {
    max-width: 680px;
    margin-inline: auto;
}

.form-card--compact {
    max-width: 360px;
}

.shortlist-share {
    max-width: 420px;
}

.footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    padding: 2.4rem 0 1.25rem;
}

.footer-block {
    display: grid;
    gap: 0.7rem;
}

.footer-block--brand {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 1rem;
}

.footer-mark {
    width: 46px;
    height: auto;
}

.site-footer {
    border-top: 1px solid rgba(197, 203, 207, 0.7);
    background: rgba(255, 255, 255, 0.78);
}

.footer-title {
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--fhh-mid);
}

.footer-copy {
    color: var(--fhh-mid);
    max-width: 46ch;
}

.footer-links {
    display: grid;
    gap: 0.4rem;
}

.footer-bottom {
    padding: 1rem 0 1.5rem;
    color: var(--fhh-mid);
    border-top: 1px solid rgba(197, 203, 207, 0.5);
}

.content-card--prose {
    padding: 1.4rem;
}

.content-card--prose p:last-child {
    margin-bottom: 0;
}

.shortlist-item h2,
.result-card h3,
.shortlist-card h2 {
    margin-bottom: 0.35rem;
}

.statement-card h2,
.sidebar-card h2,
.content-card h2 {
    margin-bottom: 0.4rem;
}

@media (max-width: 1080px) {
    .hero-grid,
    .search-layout,
    .detail-layout,
    .auth-shell,
    .statement-grid,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .page-header,
    .detail-header {
        grid-template-columns: 1fr;
    }

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

    .page-header__meta,
    .shortlist-share,
    .form-card--compact {
        max-width: none;
    }
}

@media (max-width: 840px) {
    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 1px);
        right: 1rem;
        width: min(420px, calc(100% - 2rem));
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        padding: 1rem;
        background: rgba(255, 255, 255, 0.98);
        border: 1px solid var(--fhh-line);
        border-radius: var(--fhh-radius);
        box-shadow: var(--fhh-shadow);
    }

    .site-nav.is-open {
        display: flex;
    }

    .nav-links,
    .nav-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-actions form,
    .nav-actions a,
    .nav-actions button,
    .user-pill {
        width: 100%;
    }

    .hero-stats,
    .feature-grid,
    .results-grid,
    .results-grid--shortlists,
    .field-grid,
    .field-grid--compact {
        grid-template-columns: 1fr;
    }

    .mobile-filter-bar {
        display: block;
    }

    .filter-panel {
        display: none;
    }

    .filter-panel.is-open {
        display: grid;
    }

    .shortlist-item,
    .result-card__header,
    .file-card {
        flex-direction: column;
    }

    .copy-panel {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .hero-copy h1,
    .page-header h1,
    .detail-header h1,
    .auth-aside h1 {
        font-size: 2rem;
    }

    .hero-section,
    .page-section,
    .section {
        padding: 2.6rem 0;
    }

    .container {
        width: min(var(--fhh-container), calc(100% - 1.15rem));
    }

    .brand img {
        height: 50px;
    }

    .button {
        width: 100%;
    }

    .hero-actions,
    .card-actions,
    .inline-actions,
    .pagination-row {
        flex-direction: column;
        align-items: stretch;
    }

    .pagination-summary {
        text-align: center;
    }
}
