
/* TargetJS Examples — responsive, lightweight, SEO-friendly gallery */

:root {
    color-scheme: light;
    --ink: #111b3e;
    --muted: #5f6e97;
    --page: #e7efff;
    --border: #cdd8f2;
    --accent: #7657ee;
    --yellow: #ffeb67;
    --shadow: 0 11px 26px rgba(54, 76, 136, 0.10),
              0 2px 3px rgba(70, 87, 137, 0.06);
}

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

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Inter, -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Arial, sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 93% 5%,
            rgba(162,184,255,.32) 0 160px, transparent 310px),
        radial-gradient(circle at 0% 90%,
            rgba(161,183,255,.28) 0 125px, transparent 310px),
        linear-gradient(145deg, #f0f5ff 0%, #e3ebfd 60%, #e6eaff 100%);
}

html, body {
    min-height: 100%;
    margin: 0;
}

a {
    color: inherit;
}

a:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 4px;
}

.brand:focus-visible {
    border-radius: 12px;
}

.site-nav a:focus-visible {
    border-radius: 999px;
}

/* Main layout */

.page-shell {
    width: min(1392px, calc(100% - 64px));
    margin: auto;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Header */

.site-header {
    min-height: 92px;
    display: flex;
    overflow: visible;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid rgba(139, 159, 219, .22);
    position: relative;
    z-index: 1;
    pointer-events: auto;
}

#tgjs-root {
    position: relative;
    z-index: 0;
    pointer-events: auto;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    font-size: 22px;
    font-weight: 790;
    letter-spacing: -.05em;
}

.brand-mark {
    width: 32px;
    height: 32px;
    border: 3px solid #B388FF;
    border-radius: 50%;
    background: #fce961;
    position: relative;
    display: inline-block;
}

.brand-mark::before {
    content: "";
    position: absolute;
    inset: 5px;
    border: 3px solid #B388FF;
    border-radius: 50%;
}

.brand-mark::after {
    content: "";
    position: absolute;
    width: 5px;
    height: 5px;
    left: 11px;
    top: 11px;
    border-radius: 50%;
    background: #B388FF;
}

/* Navigation */

.site-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-nav a {
    padding: 10px 17px;
    text-decoration: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 650;
}

.site-nav a:hover {
    background: rgba(122, 104, 223, .10);
}

.site-nav a[aria-current="page"] {
    color: #fff;
    background: linear-gradient(125deg, #8159fb, #606df6);
    box-shadow: 0 3px 9px #7a75e850;
}

/* Page introduction */

.intro {
    padding: 24px 0 24px;
}

.eyebrow {
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: .15em;
    font-size: 11px;
    font-weight: 800;
    color: #6962ba;
}

.intro-text {
    font-size: clamp(1rem, 1.55vw, 1.28rem);
    color: var(--muted);
    margin: 16px 0;
    max-width: 800px;
    line-height: 1.55;
}

/* Category navigation */

.category-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.category-nav a {
    border-radius: 50px;
    padding: 8px 13px;
    background: #ffffffa6;
    color: #43517e;
    text-decoration: none;
    font-size: 13px;
    font-weight: 660;
    border: 1px solid #d4dcf5;
}

.category-nav a:hover {
    background: #e0dcff;
    border-color: #ada3f2;
}

/* Example sections */

.examples-section {
    margin: 22px 0 53px;
    scroll-margin-top: 18px;
}

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 0 0 17px;
}

.section-heading h2 {
    margin: 0;
    font-size: 1.07rem;
    padding: 9px 17px;
    background: #cfdbff;
    border-radius: 999px;
    font-weight: 740;
    letter-spacing: -.018em;
}

.section-count {
    color: var(--muted);
    font-size: 12px;
    font-weight: 650;
}

/* Responsive examples grid */

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

/* Example cards */

.example-card {
    min-width: 0;
}

.example-link {
    display: block;
    height: 100%;
    color: inherit;
    text-decoration: none;
    border-radius: 19px;
    transition: transform .2s ease;
}

.example-link:hover {
    transform: translateY(-4px);
}

.example-image {
    position: relative;
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: var(--yellow);
    border: 1px solid #fff9cf;
    border-radius: 18px;
    box-shadow: var(--shadow), 0 3px 0 #becaff;
}

.example-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .26s ease;
}

.example-link:hover .example-image img {
    transform: scale(1.045);
}

/* Play icon */

.play-icon {
    position: absolute;
    top: 12px;
    right: 12px;
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,.9);
    color: #634cbb;
    font-size: 17px;
    font-weight: 750;
    box-shadow: 0 3px 10px #1f244023;
    opacity: 0;
    transform: translateY(5px);
    transition: opacity .2s, transform .2s;
}

.example-link:hover .play-icon,
.example-link:focus-visible .play-icon {
    opacity: 1;
    transform: translateY(0);
}

/* Example titles and descriptions */

.example-info {
    display: flex;
    flex-direction: column;
    padding: 17px 4px 0;
}

.example-title {
    font-size: 16px;
    line-height: 1.25;
    font-weight: 760;
    letter-spacing: -.02em;
}

.example-description {
    font-size: 13px;
    line-height: 1.5;
    margin-top: 6px;
    color: var(--muted);
}

.example-cta {
    color: #6552ce;
    font-size: 12px;
    font-weight: 730;
    margin-top: 12px;
}

.example-cta span {
    display: inline-block;
    transition: transform .2s;
}

.example-link:hover .example-cta span {
    transform: translateX(4px);
}

/* Footer */


.site-footer {
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding: 25px 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 16px;
    color: var(--muted);
    font-size: 13px;
    z-index: 1;
    flex-direction: column;
    line-height: 1.5;    
}

.site-footer a {
    color: #6f54d3;
    text-decoration: none;
    font-weight: 700;

}

/* Large desktop */

@media (min-width: 1550px) {
    .page-shell {
        width: min(1480px, calc(100% - 96px));
    }
}

/* Tablet */

@media (max-width: 1099px) {
    .page-shell {
        width: min(950px, calc(100% - 48px));
    }

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

    .intro {
        padding-top: 30px;
    }
}

/* Mobile */

@media (max-width: 620px) {
    .page-shell {
        width: calc(100% - 36px);
    }

    .site-header {
        min-height: 72px;
        gap: 10px;
    }

    .brand {
        font-size: 18px;
        gap: 8px;
    }

    .brand-mark {
        transform: scale(.8);
        margin-left: -3px;
        margin-right: -3px;
    }

    .site-nav {
        gap: 2px;
    }

    .site-nav a {
        font-size: 12px;
        padding: 9px 10px;
    }

    .intro {
        padding-top: 20px;
        padding-bottom: 16px;
    }

    .category-nav {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding: 2px 0 10px;
    }

    .category-nav::-webkit-scrollbar {
        display: none;
    }

    .category-nav a {
        flex-shrink: 0;
    }

    .examples-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 25px;
    }

    .examples-section {
        margin-bottom: 42px;
    }

    .section-heading h2 {
        font-size: .97rem;
    }

    .example-info {
        padding-top: 13px;
    }

}

/* Accessibility */

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}

@media (max-width: 350px) {
    .site-header {
        flex-wrap: wrap;
        justify-content: center;
        gap: 12px;
        padding: 14px 0;
    }

    .brand {
        flex-shrink: 0;
    }

    .site-nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }

    .site-nav a {
        white-space: nowrap;
    }
}

/* Documentation topics */

.docs-topics {
    width: 100%;
    margin: 48px 0;
}

.docs-topics-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.docs-topic {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    min-width: 0;
    background: rgba(255,255,255,.75);
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--ink);
    text-decoration: none;
    box-shadow: 0 2px 5px rgba(54,76,136,.04);
    transition: background .2s, transform .2s;
}

.docs-topic:hover {
    background: #e8e3ff;
    transform: translateY(-2px);
}

.docs-topic-number {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: #e6e3ff;
    color: #654bce;
    font-size: 12px;
    font-weight: 750;
}

.docs-topic-title {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.4;
}

.docs-topic-arrow {
    color: #8679c7;
    font-size: 18px;
    opacity: 0;
    transition: opacity .2s;
}

.docs-topic:hover .docs-topic-arrow {
    opacity: 1;
}

/* Selected documentation page */

.docs-topic[aria-current="page"] {
    color: white;
    background: linear-gradient(125deg, #8159fb, #606df6);
    border-color: transparent;
    box-shadow: 0 3px 9px #7a75e850;
}

.docs-topic[aria-current="page"] .docs-topic-number {
    color: #fff;
    background: rgba(255,255,255,.2);
}

.docs-topic[aria-current="page"] .docs-topic-arrow {
    color: white;
    opacity: 1;
}

/* Tablet */

@media (max-width: 1099px) {
    .docs-topics-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */

@media (max-width: 620px) {
    .docs-topics-grid {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .docs-topic {
        padding: 12px 14px;
    }
}

/* Documentation content */

.docs-guide {
    width: 100%;
    max-width: 1100px;
    padding: 30px 0 0;
    margin: 0 auto;
    color: var(--ink);
}

.docs-intro {
    margin-bottom: 40px;
}

.docs-guide h1 {
    margin: 0 0 22px;
    font-size: clamp(28px, 3.2vw, 42px);
    font-weight: 780;
    line-height: 1.2;
    letter-spacing: -.035em;
}

.docs-guide h2 {
    margin: 42px 0 18px;
    font-size: clamp(22px, 2.2vw, 28px);
    font-weight: 740;
    line-height: 1.3;
    letter-spacing: -.025em;
}

.docs-guide h3 {
    margin: 28px 0 14px;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.4;
}

.docs-guide p {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.8;
    color: var(--ink);
}

.docs-intro p {
    font-size: clamp(16px, 1.5vw, 19px);
    line-height: 1.75;
    color: var(--muted);
}

/* Sections */

.docs-guide section {
    margin-bottom: 48px;
}

.docs-guide section > h2:first-child {
    margin-top: 0;
}

/* Lists */

.docs-guide ul,
.docs-guide ol {
    margin: 18px 0 26px;
    padding-left: 28px;
}

.docs-guide li {
    margin-bottom: 12px;
    padding-left: 5px;
    font-size: 16px;
    line-height: 1.75;
}

.docs-guide li::marker {
    color: var(--accent);
    font-weight: 700;
}

.docs-guide strong {
    font-weight: 720;
}

/* Links */

.docs-guide a {
    color: #6552ce;
    font-weight: 650;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.docs-guide a:hover {
    color: #4c38b0;
}

/* Code blocks */

.docs-guide pre {
    width: 100%;
    margin: 20px 0 28px;
    padding: 22px 24px;
    overflow-x: auto;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: #f8faff;
    box-shadow: 0 3px 12px rgba(54, 76, 136, .06);
}

.docs-guide pre code {
    padding: 0;
    background: transparent;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 14px;
    line-height: 1.65;
    font-weight: 400;
    white-space: pre;
}

.docs-guide p code,
.docs-guide li code {
    padding: 3px 6px;
    border-radius: 5px;
    background: #e6e3ff;
    color: #5340a5;
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: .9em;
}

/* Live example area */

.docs-example {
    width: 100%;
    margin: 26px 0 32px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #fce961;
    box-shadow: var(--shadow);
}

.docs-example-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, .92);
    border-top: 1px solid var(--border);
}

/* Execution sequence */

.docs-execution {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 22px 0 32px;
}

.docs-execution-step {
    padding: 10px 15px;
    background: #e6e3ff;
    color: #5845b2;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}

.docs-execution-arrow {
    color: var(--accent);
    font-size: 20px;
    font-weight: 700;
}

/* Next steps */

.docs-guide #next-steps {
    padding: 28px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255, 255, 255, .55);
}

.docs-guide #next-steps h2 {
    margin-top: 0;
}

/* Tablet */

@media (max-width: 1099px) {
    .docs-guide {
        padding-top: 24px;
    }
}

/* Mobile */

@media (max-width: 620px) {
    .docs-guide {
        padding: 20px 0 0;
    }

    .docs-guide h1 {
        font-size: 28px;
    }

    .docs-guide h2 {
        font-size: 23px;
        margin-top: 34px;
    }

    .docs-guide h3 {
        font-size: 18px;
    }

    .docs-guide p,
    .docs-guide li {
        font-size: 15px;
        line-height: 1.7;
    }

    .docs-guide section {
        margin-bottom: 36px;
    }

    .docs-guide pre {
        padding: 16px;
        border-radius: 10px;
    }

    .docs-guide pre code {
        font-size: 12px;
    }

    .docs-guide #next-steps {
        padding: 20px;
    }
}
