/* Fonts are self-hosted: no request to Google is made (GDPR). */
@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/bricolage-grotesque-latin-500-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Bricolage Grotesque";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("fonts/bricolage-grotesque-latin-700-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url("fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Source Sans 3";
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url("fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
}

@font-face {
    font-family: "Fira Code";
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url("fonts/fira-code-500.woff2") format("woff2");
}

:root {
    color-scheme: light dark;
    --paper: #F4F6F8;
    --ink: #0E1726;
    --cobalt: #0B6FC9;   /* logo blue, darkened for text contrast */
    --blue: #1B94F5;
    --sky: #7DBDF1;
    --pink: #FF336D;
    --pink-soft: #F984A8;
    --slate: #556070;
    --line: #D9DEE5;
    --panel: #0B1F3A;
    --code-bg: #FFFFFF; --code-bar: #F6F8FA; --code-line: #D0D7DE; --code-muted: #6E7781; --code-text: #1F2328;
    --font-head: "Bricolage Grotesque", system-ui, sans-serif;
    --font-body: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 5rem; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font: 400 1.0625rem/1.6 var(--font-body);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.12; letter-spacing: -0.02em; margin: 0 0 1rem; }
h1 { font-size: clamp(2.2rem, 5.5vw, 3.6rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h3, .h3 { font-size: 1.2rem; font-weight: 500; letter-spacing: -0.01em; }
p { margin: 0 0 1rem; max-width: 62ch; }
a { color: var(--cobalt); }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; border-radius: 4px; }

.wrap { width: min(100% - 2.5rem, 68rem); margin-inline: auto; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 10; }
.skip:focus { left: 0; }

/* Header and footer */
.site-header { border-bottom: 1px solid var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.bar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: .9rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; font: 700 1.15rem var(--font-head); color: var(--ink); text-decoration: none; letter-spacing: -0.01em; }
nav { display: flex; gap: 1.4rem; }
nav a { color: var(--slate); text-decoration: none; font-weight: 600; padding-block: .25rem; border-bottom: 2px solid transparent; }
nav a:hover { color: var(--ink); }
nav a.active { color: var(--ink); border-bottom-color: var(--pink); }
.site-footer { border-top: 1px solid var(--line); margin-top: 5rem; color: var(--slate); font-size: .95rem; }
.site-footer a { color: inherit; }

/* Hero */
.hero { display: grid; gap: 3rem; grid-template-columns: 1.2fr 1fr; align-items: center; padding-block: clamp(3rem, 8vw, 6rem); }
.lead { font-size: 1.2rem; color: var(--slate); }
.actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* Buttons */
.btn {
    display: inline-block; background: var(--cobalt); color: #fff; border: 2px solid var(--cobalt);
    padding: .7rem 1.3rem; border-radius: 8px; font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer;
    transition: background-color .15s, border-color .15s;
}
.btn:hover { background: #095CA8; border-color: #095CA8; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { background: #fff; border-color: var(--ink); }
.btn-light { background: #fff; color: var(--panel); border-color: #fff; }
.btn-light:hover { background: #FDE3EB; border-color: #FDE3EB; }
.textlink { font-weight: 600; }

/* Content blocks */
.block { padding-block: 2.5rem; }
.page { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.narrow { max-width: 42rem; }
.rows { margin: 0; }
.row { display: grid; grid-template-columns: 1fr 1.6fr; gap: 2rem; padding-block: 1.5rem; border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row dt, .row h2, .row h3 { margin: 0; font-family: var(--font-head); font-weight: 500; font-size: 1.2rem; letter-spacing: -0.01em; }
.row dd { margin: 0; color: var(--slate); }
.row p { margin-bottom: .6rem; }
.result { color: var(--ink); font-weight: 600; }
.tags { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: .8rem 0 0; }
.tags li { border: 1px solid var(--line); border-radius: 999px; padding: .1rem .75rem; font-size: .9rem; color: var(--slate); background: #fff; }

.cta { background: var(--panel); color: #fff; margin-top: 3rem; padding-block: 3.5rem; }
.cta p { color: #C3D7EE; }

/* Form */
.form { display: grid; gap: 1.2rem; margin-top: 1.5rem; }
.field { display: grid; gap: .35rem; }
.field label { font-weight: 600; }
input, textarea {
    font: inherit; padding: .7rem .8rem; border: 1px solid #B9C1CD; border-radius: 8px; background: #fff; color: var(--ink); width: 100%;
}
input:focus-visible, textarea:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 1px; }
.form .btn { justify-self: start; }
.validation-message { color: #B42318; font-size: .95rem; }
input.invalid, textarea.invalid { border-color: #B42318; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.notice { padding: .9rem 1.1rem; border-radius: 8px; border: 1px solid; max-width: none; }
.notice.ok { background: #E8F6EE; border-color: #9ED8B6; color: #11512C; }
.notice.error { background: #FDECEA; border-color: #F1A9A3; color: #7A1A12; }

.popup { position: fixed; inset: 0; margin: auto; width: min(26rem, calc(100% - 2rem)); height: fit-content; overflow: visible; padding: 2rem 1.75rem 1.5rem; border: 1px solid var(--line); border-top: 4px solid var(--cobalt); border-radius: 12px; background: var(--paper); color: var(--ink); text-align: center; box-shadow: 0 20px 50px rgba(8, 20, 40, .35); }
.popup::backdrop { background: rgba(8, 20, 40, .55); }
.popup.error { border-top-color: #B42318; }
.popup h2 { margin: .5rem 0; font-size: 1.4rem; }
.popup p { margin: 0 auto 1.25rem; }
.popup form { margin: 0; }
.popup-icon { display: block; font-size: 2.6rem; line-height: 1; color: #1A7F4B; }
.popup-icon-error { width: 2.6rem; height: 2.6rem; margin: 0 auto; border-radius: 50%; background: #B42318; color: #fff; font: 700 1.7rem/2.6rem var(--font-head); }

@media (max-width: 760px) {
    .hero { grid-template-columns: 1fr; gap: 2rem; }
    .row { grid-template-columns: 1fr; gap: .5rem; }
}
@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; scroll-behavior: auto !important; }
}

.brand img { width: 2rem; height: 2rem; }
.cta { border-top: 4px solid var(--pink); }
.tags li { border-color: var(--sky); }

/* Icons (Tabler webfont) */
.row dt { display: flex; align-items: flex-start; gap: .7rem; }
.row dt .ti { color: var(--cobalt); font-size: 1.45rem; line-height: 1.2; }
.result { display: flex; align-items: flex-start; gap: .45rem; }
.result .ti { color: var(--pink); font-size: 1.2rem; margin-top: .1rem; }
.btn .ti { margin-right: .5rem; vertical-align: -0.12em; }
.site-footer a .ti { margin-right: .4rem; vertical-align: -0.1em; }


/* Hero code window */
.codewin {
    background: var(--code-bg); border: 1px solid var(--code-line); border-radius: 12px; overflow: hidden;
    box-shadow: 0 1px 2px rgba(14, 23, 38, .06), 0 14px 32px -14px rgba(14, 23, 38, .3);
    width: 100%; max-width: 30rem; justify-self: end; container-type: inline-size;
}
.codewin-bar {
    display: flex; justify-content: flex-end; gap: 1.5rem; padding: .7rem 1.1rem;
    background: var(--code-bar); border-bottom: 1px solid var(--code-line); color: var(--code-muted);
}
.codewin-bar svg { width: .7rem; height: .7rem; fill: none; stroke: currentColor; stroke-width: 1.1; }
.codewin pre {
    --pad: clamp(1rem, 4.5cqi, 1.6rem);
    margin: 0; padding: 1.4rem var(--pad) 1.6rem; tab-size: 4;
    overflow-x: auto; scrollbar-width: none; /* never show a scrollbar: it would change the height */
    font-family: "Fira Code", ui-monospace, "Cascadia Code", Consolas, monospace;
    font-weight: 500;
    /* Fit the longest line (45 characters, 0.6em each) so it can never overflow the window. */
    font-size: min(.95rem, calc((100cqi - 2 * var(--pad)) / 27.4));
    line-height: 1.75;
    color: var(--code-text);
    min-height: calc(6 * 1.75em + .25em + 3rem); /* keeps the height stable while typing (6 lines + a little slack) */
}
.codewin pre::-webkit-scrollbar { display: none; }
/* <code> has its own monospace font in the browser stylesheet: inherit the window's font so every line is exactly one line-height tall */
.codewin code { display: block; font: inherit; will-change: transform; }
.codewin .kw { color: #CF222E; }
.codewin .ty { color: #953800; }
.codewin .st { color: #0A3069; }
.codewin .cn { color: #0550AE; }
.codewin .fn { color: #8250DF; }
.codewin .cm { color: #6E7781; }
.codewin .tg { color: #116329; }
.codewin .tc { color: #82071E; }
@media (prefers-color-scheme: dark) {
    .codewin .kw { color: #FF7B72; }
    .codewin .ty { color: #FFA657; }
    .codewin .st { color: #A5D6FF; }
    .codewin .cn { color: #79C0FF; }
    .codewin .fn { color: #D2A8FF; }
    .codewin .cm { color: #8B949E; }
    .codewin .tg { color: #7EE787; }
    .codewin .tc { color: #FFA198; }
}
.caret { display: inline-block; width: .55em; height: 1.15em; margin-left: 1px; vertical-align: text-bottom; background: var(--code-text); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (max-width: 760px) { .codewin { justify-self: stretch; max-width: none; } }
@media (prefers-reduced-motion: reduce) { .caret { animation: none; } }

/* Dark theme */
@media (prefers-color-scheme: dark) {
    :root {
        --paper: #0B1220; --ink: #E8EEF7; --slate: #9AA8BB; --line: #223049; --cobalt: #4DA8FF; --panel: #0A1830;
        --code-bg: #0D1117; --code-bar: #161B22; --code-line: #30363D; --code-muted: #8B949E; --code-text: #E6EDF3;
    }
    input, textarea, .tags li { background: #101B30; color: var(--ink); border-color: #2A3A57; }
    .btn { color: #06121F; }
    .btn:hover { background: #7DBDF1; border-color: #7DBDF1; }
    .btn-ghost { color: var(--ink); background: transparent; border-color: var(--line); }
    .btn-ghost:hover { background: #101B30; border-color: var(--ink); }
    .btn-light, .btn-light:hover { color: #0A1830; }
    .codewin { box-shadow: 0 14px 32px -14px rgba(0, 0, 0, .6); }
    .notice.ok { background: #0F2A1D; border-color: #1F6B43; color: #A8E6C3; }
    .notice.error { background: #2E1412; border-color: #7A2A24; color: #F5B5AE; }
    .validation-message { color: #FF8A80; }
}

/* WhatsApp */
.btn.btn-wa { background: #0F7A6D; border-color: #0F7A6D; color: #fff; }
.btn.btn-wa:hover { background: #0B6558; border-color: #0B6558; color: #fff; }
.wa-line { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1rem; margin: 1.2rem 0 0; color: var(--slate); max-width: none; }
.wa-fab {
    position: fixed; right: max(1rem, env(safe-area-inset-right, 0px)); bottom: max(1rem, env(safe-area-inset-bottom, 0px)); z-index: 6;
    display: grid; place-items: center; width: 3.4rem; height: 3.4rem; border-radius: 50%;
    background: #0F7A6D; color: #fff; font-size: 1.8rem; text-decoration: none;
    box-shadow: 0 8px 20px -6px rgba(15, 122, 109, .7); transition: transform .15s, background-color .15s;
}
.wa-fab:hover { background: #0B6558; transform: translateY(-2px); }
.wa-fab:focus-visible { outline-color: var(--ink); }
.site-footer { padding-bottom: 4.5rem; } /* keeps the footer clear of the floating button */

/* TelEvo remote support bar (brand teal #0FB5A5, darkened on the button for white-text contrast) */
.support-bar { --teal: #0FB5A5; --teal-ink: #0B7268; background: #E7F7F5; border-bottom: 1px solid #BFE7E2; }
.support-inner { display: flex; align-items: center; gap: .9rem 1.1rem; flex-wrap: wrap; padding-block: .7rem; }
.support-inner picture, .support-inner img { width: 2.25rem; height: 2.25rem; flex: none; display: block; }
.support-inner p { margin: 0; flex: 1 1 18rem; max-width: none; line-height: 1.35; }
.support-inner strong { display: block; font: 700 1rem var(--font-head); letter-spacing: -0.01em; }
.support-inner span { color: var(--slate); font-size: .95rem; }
.btn.btn-televo {
    display: inline-flex; align-items: center; gap: .55rem; background: var(--teal-ink); border-color: var(--teal-ink); color: #fff;
    padding: .5rem 1rem; white-space: nowrap;
}
.btn.btn-televo:hover { background: #095C54; border-color: #095C54; color: #fff; }
.btn-televo svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-televo small { font-weight: 400; font-size: .8rem; opacity: .85; padding-left: .55rem; border-left: 1px solid rgba(255, 255, 255, .4); }
@media (prefers-color-scheme: dark) {
    .support-bar { background: #0A2226; border-bottom-color: #14423F; }
    .btn.btn-televo { background: var(--teal); border-color: var(--teal); color: #04211E; }
    .btn.btn-televo:hover { background: #5FD6CA; border-color: #5FD6CA; color: #04211E; }
    .btn-televo small { border-left-color: rgba(4, 33, 30, .35); }
}
@media (max-width: 520px) {
    .support-inner span { display: none; }
    .support-inner p { flex: 1 1 0; min-width: 0; }
    .btn.btn-televo { width: 100%; justify-content: center; }
}

/* Social buttons */
.social { display: flex; gap: .5rem; list-style: none; margin: 0; padding: 0; }
.social a {
    display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: 50%;
    border: 1px solid var(--line); color: var(--slate); font-size: 1.25rem; text-decoration: none;
    transition: color .15s, border-color .15s;
}
.social a:hover { color: var(--cobalt); border-color: var(--cobalt); }

.site-footer .legal { margin-top: 0; padding-bottom: .4rem; font-size: .85rem; max-width: none; }

/* Privacy page and form note */
.prose h2 { font-size: 1.25rem; margin: 2rem 0 .6rem; }
.form-note { margin: 0; font-size: .9rem; color: var(--slate); }
