:root {
    color-scheme: light;
    --bg: #f7f8f3;
    --surface: #ffffff;
    --ink: #1d2a28;
    --muted: #66716c;
    --line: #d9ded5;
    --accent: #0f766e;
    --accent-strong: #0b5d56;
    --sand: #e9dfc9;
    --sky: #d9edf0;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--bg);
}

a {
    color: inherit;
}

.site-header {
    position: relative;
    z-index: 10;
    min-height: 140px;
    padding: 10px clamp(16px, 4vw, 48px);
    border-bottom: 1px solid rgba(29, 42, 40, 0.1);
    overflow: hidden;
    background-color: #d9edf0;
    background-image:
        url("/assets/img/island-header.jpg"),
        url("/assets/img/header-tail.jpg");
    background-image: image-set(
        url("/assets/img/island-header.webp") type("image/webp"),
        url("/assets/img/island-header.jpg") type("image/jpeg")
    ), image-set(
        url("/assets/img/header-tail.webp") type("image/webp"),
        url("/assets/img/header-tail.jpg") type("image/jpeg")
    );
    background-position: left bottom, 1002px bottom;
    background-repeat: no-repeat, repeat-x;
    background-size: auto 140px, auto 140px;
}

.site-header::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.18) 56%, rgba(255, 255, 255, 0.34));
    pointer-events: none;
}

.site-title {
    position: absolute;
    top: var(--title-y, 34px);
    left: var(--title-x, 48px);
    display: block;
    min-width: 0;
    color: #ff8a00;
    font-family: "Comic Sans MS", "Comic Neue", "Trebuchet MS", ui-rounded, system-ui, sans-serif;
    font-size: var(--title-size, 74px);
    font-weight: 900;
    letter-spacing: 0;
    line-height: 0.9;
    text-decoration: none;
    text-shadow:
        3px 0 0 #ffffff,
        -3px 0 0 #ffffff,
        0 3px 0 #ffffff,
        0 -3px 0 #ffffff,
        2px 2px 0 #ffffff,
        -2px 2px 0 #ffffff,
        2px -2px 0 #ffffff,
        -2px -2px 0 #ffffff,
        0 8px 18px rgba(29, 42, 40, 0.22);
    -webkit-text-stroke: 2px #ffffff;
    user-select: auto;
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    min-height: 42px;
    padding: 0 clamp(16px, 4vw, 48px);
    border-bottom: 1px solid rgba(29, 42, 40, 0.1);
    background: rgba(255, 255, 255, 0.9);
}

.main-nav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a[aria-current="page"] {
    color: var(--accent-strong);
    outline: none;
}

.main-nav a[aria-current="page"]::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 3px;
    border-radius: 999px 999px 0 0;
    background: var(--accent);
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-left: 2px;
}

.language-switcher a {
    min-height: 28px;
    min-width: 28px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 999px;
    font-size: 18px;
    line-height: 1;
}

.language-switcher a:hover,
.language-switcher a:focus-visible,
.language-switcher a[aria-current="true"] {
    background: rgba(15, 118, 110, 0.12);
}

.language-switcher a[aria-current="true"]::after {
    display: none;
}

/*
.header-tuner {
    position: absolute;
    right: 14px;
    bottom: 10px;
    display: grid;
    gap: 6px;
    width: 286px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.86);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 24px rgba(29, 42, 40, 0.16);
    backdrop-filter: blur(8px);
}

.header-tuner strong {
    font-size: 13px;
}

.header-tuner label {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) 38px;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.header-tuner input[type="range"] {
    width: 100%;
}

.header-tuner output {
    color: var(--ink);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.header-tuner button {
    min-height: 30px;
    border: 0;
    border-radius: 8px;
    color: #ffffff;
    background: var(--accent);
    font-weight: 800;
    cursor: pointer;
}

.header-tuner small {
    color: var(--muted);
    font-size: 11px;
}
*/

.page-shell {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: clamp(22px, 4vw, 48px) clamp(16px, 4vw, 48px) clamp(28px, 6vw, 72px);
}

.hero {
    display: grid;
    min-height: min(420px, calc(100vh - 320px));
    align-items: center;
}

.hero__content {
    max-width: 720px;
}

.hero__eyebrow {
    margin: 0 0 12px;
    color: var(--accent-strong);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    overflow-wrap: break-word;
}

h1 {
    max-width: 12ch;
    margin: 0;
    font-size: clamp(42px, 12vw, 112px);
    line-height: 0.92;
    letter-spacing: 0;
}

.hero p:last-child {
    max-width: 620px;
    margin: 22px 0 0;
    color: var(--muted);
    font-size: clamp(18px, 3.5vw, 24px);
    line-height: 1.45;
}

.placeholder-section {
    padding: 44px 0;
    border-top: 1px solid rgba(29, 42, 40, 0.12);
}

.placeholder-section h2 {
    margin: 0 0 10px;
    font-size: clamp(26px, 6vw, 42px);
    line-height: 1.05;
}

.placeholder-section p {
    max-width: 680px;
    margin: 0;
    color: var(--muted);
    font-size: 18px;
    line-height: 1.6;
}

.page-shell--map {
    min-height: 420px;
}

.map-placeholder {
    display: grid;
    min-height: 320px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--muted);
    font-size: clamp(34px, 8vw, 72px);
    font-weight: 900;
}

.page-shell--firms {
    width: 100%;
    max-width: none;
    padding-top: 0;
}

.firms-page {
    display: grid;
    gap: 14px;
}

.category-filter {
    position: relative;
    z-index: 8;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin: 0 calc(clamp(16px, 4vw, 48px) * -1) 0;
    padding: 8px clamp(16px, 4vw, 48px);
    border-bottom: 1px solid rgba(11, 93, 86, 0.35);
    background: var(--accent);
    scrollbar-width: thin;
}

.category-filter__item {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 8px;
    color: var(--category-color, var(--accent));
    background: rgba(255, 255, 255, 0.9);
    font-size: 20px;
    font-weight: 900;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 0 0 rgba(0, 0, 0, 0);
    transition: border-color 140ms ease, background 140ms ease, color 140ms ease, box-shadow 140ms ease, transform 140ms ease;
}

.category-filter__item:hover,
.category-filter__item:focus-visible,
.category-filter__item[aria-current="page"],
.category-filter__item[aria-pressed="true"] {
    border-color: var(--category-color, var(--accent));
    background: #ffffff;
    outline: none;
}

.category-filter__item[aria-pressed="true"] {
    border-color: #ffffff;
    color: #ffffff;
    background: var(--category-color, var(--accent));
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.94),
        0 6px 16px rgba(7, 45, 42, 0.24);
    transform: translateY(-1px);
}

.category-filter__item[aria-pressed="true"] .category-filter__text {
    color: #ffffff;
}

.category-filter__text {
    display: none;
}

.firms-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    align-items: stretch;
    gap: 14px;
    width: min(1160px, 100%);
    margin: 0 auto;
}

.firms-empty {
    margin: 0;
    padding: 22px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--muted);
    background: #ffffff;
}

.firm-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 10px 26px rgba(29, 42, 40, 0.06);
}

.firm-card__image {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #eef1ee;
}

.firm-card__body {
    display: grid;
    gap: 10px;
    padding: 16px;
}

.firm-card__top {
    display: grid;
    gap: 8px;
}

.firm-card__category {
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    min-height: 26px;
    align-items: center;
    padding: 0 9px;
    border: 1px solid color-mix(in srgb, var(--category-color, var(--accent)) 30%, white);
    border-radius: 999px;
    color: var(--category-color, var(--accent));
    background: color-mix(in srgb, var(--category-color, var(--accent)) 10%, white);
    font-size: 12px;
    font-weight: 900;
}

.firm-card h2 {
    margin: 0;
    font-size: 24px;
    line-height: 1.05;
}

.firm-card h2 a {
    color: inherit;
    text-decoration: none;
}

.firm-card h2 a:hover,
.firm-card h2 a:focus-visible {
    color: var(--accent-strong);
    text-decoration: underline;
    outline: none;
}

.firm-card__phone {
    width: fit-content;
    color: var(--accent-strong);
    font-size: 17px;
    font-weight: 900;
    text-decoration: none;
}

.firm-card__phone:hover,
.firm-card__phone:focus-visible {
    text-decoration: underline;
    outline: none;
}

.firm-card blockquote {
    margin: 2px 0;
    padding: 10px 14px;
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    color: #263532;
    background: rgba(15, 118, 110, 0.08);
    font-size: 16px;
    font-weight: 800;
    line-height: 1.45;
}

.firm-card p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
}

.firm-detail-shell {
    max-width: 980px;
}

.firm-detail {
    display: grid;
    gap: 16px;
}

.firm-back {
    width: fit-content;
    color: var(--accent-strong);
    font-weight: 900;
    text-decoration: none;
}

.firm-back:hover,
.firm-back:focus-visible {
    text-decoration: underline;
    outline: none;
}

.firm-detail__head {
    display: grid;
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 18px;
    align-items: center;
}

.firm-detail__head > div {
    display: grid;
    gap: 10px;
}

.firm-detail__head h1 {
    max-width: none;
    font-size: clamp(34px, 7vw, 72px);
}

.firm-detail__avatar {
    display: block;
    overflow: hidden;
    width: 168px;
    aspect-ratio: 1;
    padding: 0;
    border: 1px solid rgba(29, 42, 40, 0.12);
    border-radius: 8px;
    background: #eef1ee;
    cursor: zoom-in;
}

.firm-detail__avatar img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.firm-params {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
    margin: 0;
}

.firm-params div {
    display: grid;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.firm-params dt {
    color: var(--muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.firm-params dd {
    margin: 0;
    font-size: 18px;
    font-weight: 900;
}

.firm-params a {
    color: var(--accent-strong);
    text-decoration: none;
}

.firm-detail blockquote {
    margin: 0;
    padding: 12px 16px;
    border-left: 4px solid var(--accent);
    border-radius: 0 8px 8px 0;
    color: #263532;
    background: rgba(15, 118, 110, 0.08);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.45;
}

.firm-detail__text {
    color: var(--muted);
    font-size: 18px;
    line-height: 1.65;
}

.firm-price-list {
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
}

.firm-price-list h2,
.firm-price-list h3 {
    margin: 0;
}

.firm-price-list h2 {
    font-size: 28px;
    line-height: 1.1;
}

.firm-price-list__category {
    display: grid;
    gap: 8px;
}

.firm-price-list__category h3 {
    color: var(--accent-strong);
    font-size: 20px;
}

.firm-price-list__table {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border: 1px solid rgba(29, 42, 40, 0.12);
    border-radius: 8px;
    background: #ffffff;
}

.firm-price-list__table tr:nth-child(odd) {
    background: rgba(15, 118, 110, 0.045);
}

.firm-price-list__table td {
    padding: 11px 12px;
    border-bottom: 1px solid rgba(29, 42, 40, 0.09);
    vertical-align: top;
}

.firm-price-list__table tr:last-child td {
    border-bottom: 0;
}

.firm-price-list__table td:first-child {
    width: 100%;
}

.firm-price-list__table td:last-child {
    min-width: 116px;
    color: var(--ink);
    font-weight: 900;
    text-align: right;
    white-space: nowrap;
}

.firm-price-list__table td:last-child.is-empty {
    color: rgba(29, 42, 40, 0.36);
}

.firm-price-list__table span {
    display: grid;
    gap: 3px;
    min-width: 0;
    font-weight: 800;
}

.firm-price-list__table small {
    display: block;
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
}

.firm-price-list__toggle {
    width: fit-content;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid rgba(15, 118, 110, 0.22);
    color: var(--accent-strong);
    background: rgba(15, 118, 110, 0.08);
}

.firm-price-list__toggle:hover,
.firm-price-list__toggle:focus-visible {
    color: #ffffff;
    background: var(--accent);
}

.firm-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
}

.firm-gallery button {
    overflow: hidden;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: #eef1ee;
    cursor: zoom-in;
}

.firm-gallery img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
}

.has-lightbox {
    overflow: hidden;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(10, 18, 16, 0.86);
}

.lightbox[hidden] {
    display: none;
}

.lightbox img {
    display: block;
    max-width: min(1100px, 96vw);
    max-height: 88vh;
    border-radius: 8px;
    object-fit: contain;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

.lightbox__close {
    position: fixed;
    top: 14px;
    right: 14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 999px;
    color: var(--ink);
    background: #ffffff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 20px 16px;
    border-top: 1px solid rgba(29, 42, 40, 0.1);
    color: var(--muted);
    background: rgba(255, 255, 255, 0.68);
    font-size: 14px;
}

@media (max-width: 640px) {
    .site-header {
        min-height: 88px;
        padding-top: 6px;
        padding-bottom: 6px;
        background-position: left bottom, 630px bottom;
        background-size: auto 88px, auto 88px;
    }

    .main-nav {
        gap: 18px;
        overflow-x: auto;
    }

    .main-nav a {
        flex: 0 0 auto;
    }

    .hero {
        min-height: min(380px, calc(100vh - 300px));
    }

    .site-title {
        max-width: 100%;
        top: min(var(--title-y, 34px), 24px);
        font-size: min(var(--title-size, 74px), 36px);
    }

    .firm-detail__head {
        grid-template-columns: 92px minmax(0, 1fr);
        gap: 12px;
    }

    .firm-detail__avatar {
        width: 92px;
    }

    .firm-detail__head h1 {
        font-size: 32px;
    }

    .firm-price-list {
        padding: 12px;
    }

    .firm-price-list h2 {
        font-size: 24px;
    }

    .firm-price-list__table td {
        padding: 9px 8px;
    }

    .firm-price-list__table td:last-child {
        min-width: 86px;
        font-size: 14px;
    }

    .header-tuner {
        position: static;
        width: auto;
        margin: 8px;
    }
}

@media (min-width: 720px) {
    .category-filter {
        flex-wrap: wrap;
        overflow: visible;
    }

    .category-filter__item {
        width: auto;
        min-width: 0;
        padding: 0 12px;
        gap: 8px;
        font-size: 17px;
    }

    .category-filter__text {
        display: inline;
        color: var(--ink);
        font-size: 14px;
    }

    .firm-card {
        grid-template-columns: minmax(0, 1fr);
    }

    .firm-card__image {
        height: auto;
        min-height: 0;
        aspect-ratio: 4 / 3;
    }

    .firm-card__body {
        padding: 16px;
    }
}
}
