:root {
    --thp-ink: #172026;
    --thp-ink-soft: #33414a;
    --thp-panel: #ffffff;
    --thp-paper: #f4f1ea;
    --thp-muted: #6f7a81;
    --thp-line: rgba(23, 32, 38, 0.14);

    --thp-accent: #587386;
    --thp-accent-dark: #2f4a5c;

    --thp-general: #6d95a7;
    --thp-haabase: #5a7852;
    --thp-translation: #8a6845;

    --thp-header: #1f2b33;
    --thp-header-2: #31434f;
}

/* -------------------------------------------------------
   Base
------------------------------------------------------- */

body {
    margin: 0;
    color: var(--thp-ink);
    background: var(--thp-paper);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
    color: var(--thp-accent-dark);
}

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

/* -------------------------------------------------------
   Navbar and logo
------------------------------------------------------- */

.thp-navbar {
    background: var(--thp-header);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
}

.thp-navbar .navbar-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.85rem;
    padding-top: 0;
    padding-bottom: 0;
    color: #ffffff;
    text-decoration: none;
}

.thp-navbar .navbar-brand:hover,
.thp-navbar .navbar-brand:focus {
    color: #ffffff;
}

.brand-mark {
    display: inline-block;
    color: var(--thp-general);
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    margin: 0;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;

    font-size: 2.35rem;
    font-weight: 500;
    line-height: 1.12;
    letter-spacing: -0.06em;
    text-transform: lowercase;
}

.brand-text {
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: rgba(255, 255, 255, 0.95);
}

/* Section logo colours */
body.theme-general .brand-mark {
    color: var(--thp-general);
}

body.theme-haabase .brand-mark {
    color: var(--thp-haabase);
}

body.theme-translation .brand-mark {
    color: var(--thp-translation);
}

.thp-navbar .nav-link {
    color: rgba(255, 255, 255, 0.78);
    font-weight: 500;
    padding-top: 0.35rem;
    padding-bottom: 0.35rem;
}

.thp-navbar .nav-link:hover,
.thp-navbar .nav-link.active {
    color: #ffffff;
}

body.theme-general .thp-navbar .nav-link.active {
    color: #9fc1d1;
}

body.theme-haabase .thp-navbar .nav-link.active {
    color: #9eb89b;
}

body.theme-translation .thp-navbar .nav-link.active {
    color: #c8ad90;
}


.credential-logos {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-top: 1rem;
}

.credential-logos img {
    max-height: 42px;
    width: auto;
    display: block;
}
/* -------------------------------------------------------
   Header
------------------------------------------------------- */

.site-header {
    color: #ffffff;
    background:
        linear-gradient(130deg, rgba(31, 43, 51, 0.74), rgba(31, 43, 51, 0.62)),
        url("/img/header-thp.png");
    background-size: cover;
    background-position: center;
    padding: 0.95rem 0;
}

body.page-home .site-header {
    padding: 1.25rem 0 1.15rem;
}

.site-header-inner {
    max-width: 860px;
}

.header-kicker {
    margin: 0 0 0.25rem 0;
    color: rgba(255, 255, 255, 0.72);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.68rem;
    line-height: 1.2;
    font-weight: 700;
}

.site-header h1 {
    max-width: 850px;
    margin: 0 0 0.65rem 0;
    font-size: clamp(1.55rem, 2.4vw, 2.15rem);
    line-height: 1.08;
    letter-spacing: -0.025em;
    font-weight: 500;
}

body.page-home .site-header h1 {
    font-size: clamp(1.85rem, 3vw, 2.65rem);
    letter-spacing: -0.03em;
    font-weight: 500;
}

.header-lead {
    max-width: 760px;
    margin: 0;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.96rem;
    line-height: 1.38;
    font-weight: 400;
}

body.page-home .header-lead {
    font-size: 1rem;
}

/* -------------------------------------------------------
   Main layout
------------------------------------------------------- */

.site-main {
    padding: 3.2rem 0;
}

.section-panel,
.card-panel {
    background: var(--thp-panel);
    border: 1px solid var(--thp-line);
    border-radius: 1.25rem;
    box-shadow: 0 18px 42px rgba(23, 32, 38, 0.06);
}

.section-panel {
    padding: clamp(1.35rem, 3vw, 2.4rem);
}

.card-panel {
    height: 100%;
    padding: 1.6rem;
}

.eyebrow {
    color: var(--thp-accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.75rem;
    font-weight: 750;
    margin-bottom: 0.7rem;
}

.prose {
    font-size: 1.03rem;
    line-height: 1.72;
    color: var(--thp-ink-soft);
}

.prose h2,
.section-title {
    color: var(--thp-ink);
    letter-spacing: -0.025em;
    font-weight: 700;
}

.card-icon {
    width: 3rem;
    height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.9rem;
    background: rgba(88, 115, 134, 0.13);
    color: var(--thp-accent-dark);
    font-size: 1.35rem;
    margin-bottom: 1.1rem;
}

.card-panel h2,
.card-panel h3 {
    font-size: 1.32rem;
    letter-spacing: -0.02em;
    margin-bottom: 0.7rem;
}

.card-panel p,
.card-panel li {
    color: var(--thp-ink-soft);
    line-height: 1.62;
}

/* -------------------------------------------------------
   Buttons
------------------------------------------------------- */

.btn-thp {
    --bs-btn-color: #fff;
    --bs-btn-bg: var(--thp-accent-dark);
    --bs-btn-border-color: var(--thp-accent-dark);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--thp-ink);
    --bs-btn-hover-border-color: var(--thp-ink);
    border-radius: 0.65rem;
    font-weight: 650;
}

.btn-outline-thp {
    --bs-btn-color: var(--thp-accent-dark);
    --bs-btn-border-color: rgba(47, 74, 92, 0.45);
    --bs-btn-hover-color: #fff;
    --bs-btn-hover-bg: var(--thp-accent-dark);
    --bs-btn-hover-border-color: var(--thp-accent-dark);
    border-radius: 0.65rem;
    font-weight: 650;
}

.btn-link-thp {
    color: #2f5f73;
    font-weight: 700;
    text-decoration: none;
}

.btn-link-thp:hover,
.btn-link-thp:focus {
    color: #18343f;
    text-decoration: underline;
}

/* -------------------------------------------------------
   Shared content components
------------------------------------------------------- */

.meta-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    overflow: hidden;
    border-radius: 1.1rem;
    border: 1px solid var(--thp-line);
    background: var(--thp-line);
}

.meta-strip div {
    background: rgba(255, 255, 255, 0.76);
    padding: 1.15rem;
}

.meta-strip strong {
    display: block;
    margin-bottom: 0.25rem;
}

.meta-strip span {
    color: var(--thp-muted);
    font-size: 0.95rem;
}

.callout {
    border-left: 0.32rem solid var(--thp-accent);
    background: rgba(255, 255, 255, 0.72);
    padding: 1.2rem 1.4rem;
    border-radius: 0.9rem;
}

.evidence-box {
    border: 1px solid var(--thp-line);
    background: rgba(88, 115, 134, 0.09);
    border-radius: 1.1rem;
    padding: 1.25rem;
}

.evidence-box strong {
    display: block;
    color: var(--thp-ink);
    font-size: 1.05rem;
    margin-bottom: 0.45rem;
}

.evidence-box span {
    display: block;
    color: var(--thp-ink-soft);
    line-height: 1.55;
}

/* -------------------------------------------------------
   Stats and process blocks
------------------------------------------------------- */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    overflow: hidden;
    border-radius: 1.2rem;
    border: 1px solid var(--thp-line);
    background: var(--thp-line);
    box-shadow: 0 18px 42px rgba(23, 32, 38, 0.05);
}

.stats-grid div {
    background: rgba(255, 255, 255, 0.82);
    padding: 1.25rem;
}

.stats-grid strong {
    display: block;
    color: var(--thp-accent-dark);
    font-size: clamp(1.6rem, 3vw, 2.3rem);
    line-height: 1;
    letter-spacing: -0.04em;
    margin-bottom: 0.45rem;
}

.stats-grid span {
    color: var(--thp-ink-soft);
    font-size: 0.95rem;
    line-height: 1.45;
}

.process-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.process-grid article {
    border: 1px solid var(--thp-line);
    border-radius: 1rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.68);
}

.process-grid span {
    display: inline-block;
    color: var(--thp-accent-dark);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.72rem;
    font-weight: 750;
    margin-bottom: 0.45rem;
}

.process-grid h3 {
    font-size: 1.18rem;
    color: var(--thp-ink);
    margin-bottom: 0.5rem;
}

.process-grid p {
    margin-bottom: 0;
}

.process-list {
    counter-reset: process;
    list-style: none;
    padding-left: 0;
    display: grid;
    gap: 0.65rem;
}

.process-list li {
    counter-increment: process;
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    color: var(--thp-ink-soft);
}

.process-list li::before {
    content: counter(process);
    flex: 0 0 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(88, 115, 134, 0.14);
    color: var(--thp-accent-dark);
    font-size: 0.85rem;
    font-weight: 750;
}

/* -------------------------------------------------------
   Lists
------------------------------------------------------- */

.check-list {
    padding-left: 0;
    list-style: none;
}

.check-list li {
    position: relative;
    padding-left: 1.65rem;
    margin-bottom: 0.55rem;
}

.check-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--thp-accent-dark);
    font-weight: 800;
}

.quote-checklist {
    margin-bottom: 0;
}

.quote-checklist li {
    margin-bottom: 0.4rem;
}

/* -------------------------------------------------------
   Language and project links
------------------------------------------------------- */

.language-switch {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    align-items: center;
    margin: 0 0 1.25rem 0;
    color: var(--thp-ink-soft);
    font-size: 0.95rem;
}

.language-switch span,
.mini-language-links span {
    font-weight: 650;
}

.language-switch a {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--thp-line);
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.72);
    color: var(--thp-accent-dark);
    text-decoration: none;
    font-weight: 650;
}

.language-switch a:hover,
.language-switch a:focus {
    background: #fff;
    color: var(--thp-ink);
    border-color: rgba(88, 115, 134, 0.45);
}

.card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
    align-items: center;
}

.mini-language-links,
.mini-project-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.55rem;
    align-items: center;
    color: var(--thp-muted);
    font-size: 0.9rem;
}

.mini-project-links {
    margin-top: 0.85rem;
    font-size: 0.88rem;
}

.mini-language-links a,
.mini-project-links a {
    color: var(--thp-accent-dark);
    font-weight: 650;
    text-decoration: none;
    border-bottom: 1px solid rgba(88, 115, 134, 0.35);
}

.mini-language-links a:hover,
.mini-language-links a:focus,
.mini-project-links a:hover,
.mini-project-links a:focus {
    color: var(--thp-ink);
    border-bottom-color: var(--thp-ink);
}

/* -------------------------------------------------------
   HAABase-specific sections
------------------------------------------------------- */

.haabase-wales-feature,
.haabase-scale-feature {
    border-left: 5px solid var(--thp-accent);
}

.programme-box {
    background: rgba(18, 41, 54, 0.045);
    border: 1px solid rgba(18, 41, 54, 0.12);
    border-radius: 1rem;
    padding: 1.25rem;
}

.programme-box h3 {
    font-size: 1.05rem;
    margin-bottom: 1rem;
}

.programme-box dl {
    margin: 0;
}

.programme-box div {
    padding: 0.75rem 0;
    border-top: 1px solid rgba(18, 41, 54, 0.12);
}

.programme-box div:first-child {
    border-top: 0;
    padding-top: 0;
}

.programme-box dt {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--thp-muted);
    margin-bottom: 0.2rem;
}

.programme-box dd {
    margin: 0;
    font-weight: 600;
}

.use-case-grid,
.public-register-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.use-case-grid article,
.register-card {
    border: 1px solid var(--thp-line);
    border-radius: 1rem;
    padding: 1.15rem;
    background: rgba(255, 255, 255, 0.68);
}

.register-card {
    padding: 1.25rem;
    min-height: 100%;
}

.use-case-grid h3,
.register-card h3 {
    color: var(--thp-ink);
    font-size: 1.08rem;
    margin-bottom: 0.45rem;
}

.register-card h3 {
    font-size: 1.18rem;
    margin-bottom: 0.55rem;
}

.use-case-grid p,
.register-card p {
    margin: 0;
    font-size: 0.96rem;
    line-height: 1.55;
}

.register-card p {
    font-size: 0.98rem;
    line-height: 1.6;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    border: 1px solid rgba(18, 41, 54, 0.18);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    color: var(--thp-muted);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    background: rgba(18, 41, 54, 0.045);
}

/* -------------------------------------------------------
   Notices, contact and forms
------------------------------------------------------- */

.notice-panel {
    background: #f3f6f7;
    border: 1px solid rgba(24, 52, 63, 0.14);
    border-left: 4px solid #2f5f73;
    border-radius: 1rem;
    padding: 1rem 1.25rem;
}

.notice-panel-success {
    border-left-color: #3d7a57;
}

.notice-panel-error {
    border-left-color: #9b3d2e;
    background: #fff7f5;
}

.contact-route-card .contact-email-box {
    margin-top: 1.25rem;
    padding: 1rem;
    border-radius: 0.85rem;
    background: #f8fafb;
    border: 1px solid rgba(24, 52, 63, 0.12);
}

.contact-label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #5f7078;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.contact-email-box a {
    font-weight: 700;
    word-break: break-word;
}

.form-panel {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.thp-form .form-label {
    font-weight: 700;
    color: #18343f;
}

.thp-form .form-control,
.thp-form .form-select {
    border-radius: 0.75rem;
    border-color: rgba(24, 52, 63, 0.22);
    padding: 0.72rem 0.85rem;
}

.thp-form .form-control:focus,
.thp-form .form-select:focus {
    border-color: #2f5f73;
    box-shadow: 0 0 0 0.2rem rgba(47, 95, 115, 0.14);
}

.required {
    color: #9b3d2e;
}

.form-honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
}

/* -------------------------------------------------------
   Footer
------------------------------------------------------- */

.site-footer {
    background: var(--thp-header);
    color: rgba(255, 255, 255, 0.74);
    padding: 1.55rem 0 1rem;
}

.footer-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    max-width: 720px;
}

.footer-brand-mark {
    color: var(--thp-general);
    font-size: 1.8rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.06em;
    text-transform: lowercase;
    flex: 0 0 auto;
    margin-top: 0.05rem;
}

.site-footer h2,
.footer-brand h2 {
    color: #ffffff;
    font-size: 1.02rem;
    line-height: 1.2;
    margin: 0 0 0.2rem;
}

.footer-brand p {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.68);
}

.footer-certification {
    margin-top: 0.4rem;
}

.footer-certification img {
    max-height: 50px;
    width: auto;
    display: block;
    opacity: 0.82;
}

.footer-links {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    font-size: 0.88rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.76);
    text-decoration: none;
}

.footer-links a:hover,
.footer-links a:focus {
    color: #ffffff;
}

.footer-bottom {
    margin-top: 0.85rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.52);
    font-size: 0.82rem;
}

/* -------------------------------------------------------
   Responsive
------------------------------------------------------- */

@media (max-width: 991.98px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .process-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767.98px) {
    .brand-mark {
        font-size: 2rem;
    }

    .brand-text {
        font-size: 0.92rem;
    }

    .site-header {
        padding: 0.8rem 0;
    }

    body.page-home .site-header {
        padding: 1rem 0 0.95rem;
    }

    .site-header h1 {
        font-size: clamp(1.35rem, 6vw, 1.9rem);
    }

    .header-lead {
        font-size: 0.93rem;
    }

    .site-main {
        padding: 2rem 0;
    }

    .meta-strip,
    .use-case-grid,
    .public-register-grid {
        grid-template-columns: 1fr;
    }

    .footer-main {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.95rem;
    }

    .footer-brand {
        align-items: flex-start;
        gap: 0.75rem;
    }

    .footer-brand-mark {
        font-size: 1.65rem;
    }

    .footer-links {
        justify-content: flex-start;
    }
}

@media (max-width: 575.98px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* -------------------------------------------------------
   HAABase compact screenshot thumbnails
------------------------------------------------------- */

.screenshot-thumb-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.9rem;
}

.screenshot-thumb {
    display: block;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--thp-line);
    border-radius: 0.95rem;
    overflow: hidden;
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(23, 32, 38, 0.06);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.screenshot-thumb:hover,
.screenshot-thumb:focus {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(23, 32, 38, 0.11);
    border-color: rgba(88, 115, 134, 0.42);
}

.screenshot-thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: top left;
    background: #ffffff;
    border-bottom: 1px solid var(--thp-line);
}

.screenshot-thumb span {
    display: block;
    padding: 0.8rem 0.85rem 0.9rem;
}

.screenshot-thumb strong {
    display: block;
    color: var(--thp-ink);
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.screenshot-thumb small {
    display: block;
    color: var(--thp-ink-soft);
    font-size: 0.82rem;
    line-height: 1.4;
}

@media (max-width: 1199.98px) {
    .screenshot-thumb-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .screenshot-thumb-grid {
        grid-template-columns: 1fr;
    }

    .screenshot-thumb img {
        aspect-ratio: 16 / 9;
    }
}

.btn-haabase-link {
    background-color: #e8f0ed;
    color: #123d34;
    border: 1px solid #123d34;
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
    font-weight: 600;
    text-decoration: none;
}

.btn-haabase-link:hover,
.btn-haabase-link:focus {
    background-color: #123d34;
    color: #ffffff;
    text-decoration: none;
}
