:root {
    --bg: #fbfbf7;
    --ink: #18211f;
    --muted: #5f6c68;
    --line: #dde5df;
    --panel: #ffffff;
    --teal: #0f8b8d;
    --coral: #ef5b5b;
    --green: #2f9e44;
    --amber: #f4b942;
    --shadow: 0 18px 50px rgba(24, 33, 31, 0.1);
    --radius: 8px;
    --container: 1160px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.6;
}

body.nav-open {
    overflow: hidden;
}

body.age-banner-open {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

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

svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.container {
    width: min(100% - 32px, var(--container));
    margin: 0 auto;
}

.skip-link {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 20;
    transform: translateY(-140%);
    padding: 10px 14px;
    background: var(--ink);
    color: #fff;
    border-radius: var(--radius);
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(251, 251, 247, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(221, 229, 223, 0.9);
}

.nav {
    min-height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: max-content;
}

.brand__mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: var(--muted);
    margin-top: -2px;
}

.nav__links {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.nav__links a {
    padding: 9px 11px;
    border-radius: 8px;
    color: #33413d;
    transition: background 0.2s ease, color 0.2s ease;
}

.nav__links a:hover {
    background: #edf5ef;
    color: var(--ink);
}

.nav__cta {
    background: var(--ink);
    color: #fff !important;
}

.nav__toggle {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 5px;
}

.nav__toggle span {
    width: 20px;
    height: 2px;
    background: var(--ink);
    border-radius: 10px;
}

.hero {
    position: relative;
    min-height: clamp(620px, 88vh, 820px);
    display: flex;
    align-items: center;
    overflow: hidden;
    isolation: isolate;
}

.hero__image {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-image: linear-gradient(90deg, rgba(12, 24, 20, 0.88), rgba(12, 24, 20, 0.55) 48%, rgba(12, 24, 20, 0.15)), url("/assets/images/thailand-apps-hero.jpg");
    background-size: cover;
    background-position: center;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 130px;
    z-index: -1;
    background: linear-gradient(0deg, var(--bg), rgba(251, 251, 247, 0));
}

.hero__content {
    color: #fff;
    padding: 88px 0 140px;
}

.hero h1 {
    max-width: 760px;
    margin: 12px 0 18px;
    font-size: clamp(42px, 7vw, 86px);
    line-height: 0.96;
    letter-spacing: 0;
}

.hero p {
    max-width: 650px;
    font-size: 18px;
    color: rgba(255, 255, 255, 0.86);
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--teal);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #9ff0d0;
}

.hero-search,
.filter-bar {
    width: min(100%, 720px);
    margin-top: 30px;
}

.hero-search label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
}

.hero-search div,
.filter-bar {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

.filter-bar {
    grid-template-columns: 1fr minmax(180px, 240px) auto;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 14px;
    color: var(--ink);
    background: #fff;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(15, 139, 141, 0.14);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 12px 18px;
    border: 1px solid var(--ink);
    border-radius: 8px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 24px rgba(24, 33, 31, 0.18);
}

.button--ghost {
    background: transparent;
    color: var(--ink);
}

.button--light {
    background: #fff;
    color: var(--ink);
    border-color: #fff;
}

.age-banner {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    padding: 18px;
}

.age-banner__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 14, 12, 0.68);
    backdrop-filter: blur(10px);
}

.age-banner__dialog {
    position: relative;
    width: min(100%, 520px);
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
    animation: ageBannerIn 0.26s ease both;
}

.age-banner__dialog h2 {
    margin: 0 0 12px;
    font-size: clamp(54px, 12vw, 104px);
    line-height: 0.92;
    letter-spacing: 0;
}

.age-banner__dialog p:not(.eyebrow) {
    margin: 0;
    color: #7d8985;
    font-size: 14px;
    line-height: 1.55;
}

.age-banner__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 24px;
}

.age-banner__yes {
    border-color: #1f8f4d;
    background: #1f8f4d;
    color: #fff;
}

.age-banner__yes:hover {
    box-shadow: 0 12px 24px rgba(31, 143, 77, 0.24);
}

.age-banner__no {
    border-color: #c73c3c;
    background: #c73c3c;
    color: #fff;
}

.age-banner__no:hover {
    box-shadow: 0 12px 24px rgba(199, 60, 60, 0.22);
}

@keyframes ageBannerIn {
    from {
        opacity: 0;
        transform: translateY(14px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.section {
    padding: 76px 0;
}

.section--tint {
    background: #eef6f1;
}

.section__head {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(280px, 0.7fr);
    gap: 32px;
    align-items: end;
    margin-bottom: 28px;
}

.section__head h2,
.split h2,
.newsletter h2,
.advice h2,
.prose h2 {
    margin: 0;
    font-size: clamp(28px, 4vw, 46px);
    line-height: 1.08;
    letter-spacing: 0;
}

.section__head p,
.split p,
.advice p {
    color: var(--muted);
    margin: 0;
}

.category-grid,
.app-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

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

.category-card,
.app-card,
.fact-box,
.checklist,
.contact-form {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 8px 28px rgba(24, 33, 31, 0.06);
}

.category-card {
    min-height: 220px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover,
.app-card:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--accent, var(--teal)) 42%, var(--line));
    box-shadow: var(--shadow);
}

.category-card__icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, #fff);
}

.category-card h3,
.app-card h3 {
    margin: 16px 0 8px;
    font-size: 21px;
    line-height: 1.2;
}

.category-card p,
.app-card p {
    margin: 0;
    color: var(--muted);
}

.app-card {
    padding: 22px;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.app-card__top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.app-logo {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 45%, #111));
    font-weight: 900;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--accent) 22%, transparent);
}

.app-logo--large {
    width: 96px;
    height: 96px;
    font-size: 42px;
}

.app-card__meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: auto 0 18px;
    padding-top: 18px;
}

.app-card__meta span {
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: #40504b;
    background: #f7faf8;
    font-size: 13px;
}

.text-link {
    font-weight: 800;
    color: var(--teal);
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(280px, 0.8fr);
    gap: 36px;
    align-items: start;
}

.checklist {
    padding: 22px;
}

.checklist p + p {
    margin-top: 16px;
}

.page-hero {
    padding: 86px 0;
    background: linear-gradient(135deg, color-mix(in srgb, var(--accent, var(--teal)) 18%, #fff), #fbfbf7 70%);
    border-bottom: 1px solid var(--line);
}

.page-hero.compact h1 {
    max-width: 900px;
    margin: 0 0 14px;
    font-size: clamp(38px, 6vw, 70px);
    line-height: 1;
    letter-spacing: 0;
}

.page-hero.compact p:not(.eyebrow) {
    max-width: 820px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
}

.app-page__hero {
    display: flex;
    align-items: center;
    gap: 24px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.app-detail {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
}

.fact-box {
    position: sticky;
    top: 96px;
    padding: 22px;
}

.fact-box h2 {
    margin-top: 0;
}

.prose {
    color: #26332f;
}

.prose.narrow {
    max-width: 820px;
}

.prose h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 30px;
}

.prose h2:not(:first-child) {
    margin-top: 34px;
}

.prose p,
.prose li {
    color: #4e5c58;
}

.prose a {
    color: var(--teal);
    font-weight: 800;
}

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

.advice {
    max-width: 900px;
}

.result-count {
    margin-bottom: 18px;
    color: var(--muted);
    font-weight: 700;
}

.contact-grid {
    display: grid;
    grid-template-columns: minmax(0, 0.8fr) minmax(300px, 0.8fr);
    gap: 32px;
}

.contact-form {
    display: grid;
    gap: 14px;
    padding: 22px;
}

.contact-form label {
    display: grid;
    gap: 7px;
    font-weight: 800;
}

.newsletter {
    padding: 52px 0;
    background: var(--ink);
    color: #fff;
}

.newsletter__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
}

.newsletter p {
    max-width: 720px;
    margin: 10px 0 0;
    color: rgba(255, 255, 255, 0.74);
}

.site-footer {
    padding: 46px 0;
    background: #101816;
    color: #d7e0dc;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(150px, 0.5fr));
    gap: 30px;
}

.site-footer p,
.site-footer small {
    color: #9aa8a3;
}

.site-footer h3 {
    margin: 0 0 12px;
    color: #fff;
}

.site-footer a:not(.brand) {
    display: block;
    margin: 8px 0;
    color: #d7e0dc;
}

.brand--footer .brand__mark {
    background: #fff;
    color: var(--ink);
}

[hidden] {
    display: none !important;
}

@media (max-width: 980px) {
    .nav__toggle {
        display: flex;
    }

    .nav__links {
        position: fixed;
        inset: 72px 16px auto;
        display: none;
        flex-direction: column;
        align-items: stretch;
        padding: 14px;
        background: #fff;
        border: 1px solid var(--line);
        border-radius: 8px;
        box-shadow: var(--shadow);
    }

    body.nav-open .nav__links {
        display: flex;
    }

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

    .section__head,
    .split,
    .app-detail,
    .contact-grid {
        grid-template-columns: 1fr;
    }

    .fact-box {
        position: static;
    }
}

@media (max-width: 680px) {
    .container {
        width: min(100% - 24px, var(--container));
    }

    .hero {
        min-height: 720px;
        align-items: flex-end;
    }

    .hero__image {
        background-image: linear-gradient(0deg, rgba(12, 24, 20, 0.9), rgba(12, 24, 20, 0.38)), url("/assets/images/thailand-apps-hero.jpg");
        background-position: 60% center;
    }

    .hero__content {
        padding: 86px 0 128px;
    }

    .hero-search div,
    .filter-bar,
    .newsletter__inner,
    .app-page__hero,
    .hero-actions,
    .age-banner__actions {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: stretch;
    }

    .button {
        width: 100%;
    }

    .category-grid,
    .app-grid,
    .columns,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .section,
    .page-hero {
        padding: 54px 0;
    }
}
