:root {
    --site-shell-width: 1440px;
    --site-shell-gutter: clamp(1rem, 2.4vw, 1.6rem);
    --site-polish-radius: 24px;
    --site-polish-radius-md: 20px;
    --site-polish-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
    --site-polish-pill-height: 2.9rem;
    --site-polish-icon-size: 2.8rem;
}

html {
    scroll-padding-top: calc(var(--site-header-height, 96px) + 18px);
}

body {
    overflow-x: hidden;
}

main {
    overflow-x: clip;
}

main [id] {
    scroll-margin-top: calc(var(--site-header-height, 96px) + 20px);
}

main :is(p, li, dd, dt, blockquote, figcaption, a, code, kbd, samp) {
    overflow-wrap: anywhere;
}

main pre {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.bg-clip-text,
.text-transparent.bg-clip-text,
.gradient-text,
.gradient-text-animated {
    background: none !important;
    background-image: none !important;
    color: inherit !important;
    -webkit-background-clip: border-box !important;
    background-clip: border-box !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none !important;
    animation: none !important;
}

.site-header__inner,
.site-footer__inner {
    width: min(var(--site-shell-width), 100%) !important;
    padding-inline: var(--site-shell-gutter);
    box-sizing: border-box;
}

.au-home .container,
.about-portfolio .container,
.learning-page .container,
.api-hub .container,
.projects-shell .container,
.ctv-shell .container,
.lab-container .container,
.privacy-shell .container,
.python-shell .container,
.topic-shell .container {
    width: min(var(--site-shell-width), 100%) !important;
    max-width: none !important;
    margin: 0 auto !important;
    padding-inline: var(--site-shell-gutter) !important;
    box-sizing: border-box !important;
}

.projects-wrap,
.python-wrap {
    width: min(var(--site-shell-width), 100%) !important;
    margin: 0 auto !important;
    padding-inline: var(--site-shell-gutter) !important;
    box-sizing: border-box !important;
}

.blog-page .blog-wrap,
.blog-page .article-wrap {
    width: min(var(--site-shell-width), 100%) !important;
    margin: 0 auto !important;
    padding-inline: var(--site-shell-gutter) !important;
    box-sizing: border-box !important;
}

.blog-page :is(.blog-shell, .article-shell) {
    overflow: visible;
}

.blog-page :is(.blog-hero, .blog-card, .article-hero, .article-panel) {
    box-sizing: border-box;
}

.blog-page :is(.blog-title, .article-title) {
    max-width: min(16ch, 100%);
    text-wrap: balance;
}

.blog-page :is(.blog-lede, .article-lede) {
    max-width: 72ch;
}

.blog-page :is(.blog-lede, .article-lede, .blog-card__summary, .article-body p, .article-body li) {
    overflow-wrap: anywhere;
}

.blog-page :is(.link-row, .quick-nav, .blog-meta, .article-meta) {
    align-items: stretch;
}

.blog-page :is(.quick-nav a, .link-btn, .blog-link) {
    min-height: var(--site-polish-pill-height);
}

.section-heading,
.api-section-heading,
.story-section-heading,
.track-intro-header,
.projects-section__head,
.python-section__head,
.section-header,
.topic-section__head,
.ctv2-section-head,
.privacy-header {
    max-width: min(58rem, 100%) !important;
}

.hero-summary,
.section-heading p,
.story-section-heading p,
.track-intro-header p,
.api-section-heading p,
.projects-hero__lede,
.python-hero__lede,
.tracker-lede,
.api-lead {
    max-width: 72ch;
}

.topic-hero__lede,
.ctv2-subtitle,
.ctv2-support,
.privacy-header p {
    max-width: 72ch;
}

.section-heading h2,
.api-section-heading h2,
.story-section-heading h3,
.track-intro-header h2,
.projects-section__head h2,
.python-section__head h2,
.section-header h2,
.topic-section__head h2,
.ctv2-section-title,
.privacy-header h1 {
    margin-bottom: 0 !important;
}

.section-heading p,
.api-section-heading p,
.story-section-heading p,
.track-intro-header p,
.projects-section__head p,
.python-section__head p,
.section-header p,
.topic-section__head p,
.privacy-header p,
.ctv2-section-copy {
    margin-top: 0 !important;
}

.about-copy-stack,
.content-stack {
    max-width: 72ch;
}

.projects-hero,
.python-hero,
.about-hero__grid,
.api-hero-grid,
.hero-grid {
    align-items: stretch;
}

.projects-hero__rail,
.python-hero__rail {
    grid-auto-rows: 1fr;
}

.projects-rail-card,
.python-rail-card,
.step-card {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.projects-hero,
.projects-panel,
.project-card,
.python-hero,
.python-panel,
.python-card,
.api-lab-panel,
.api-lab-output,
.track-intro-shell,
.hero-copy,
.about-hero__copy,
.about-hero__panel {
    box-sizing: border-box;
}

.topic-map-grid,
.two-column-grid,
.tool-grid,
.build-grid,
.journey-grid,
.snapshot-grid,
.api-card-grid,
.api-method-grid,
.api-example-grid,
.api-path-grid,
.api-quiz-list,
.hero-grid,
.track-intro-grid,
.hero-signal-grid,
.scenarios-grid,
.runbook-grid,
.qa-grid,
.ref-grid,
.detail-grid,
.roadmap-grid,
.projects-grid,
.projects-checklist {
    align-items: stretch !important;
}

.topic-map-card,
.snapshot-card,
.content-card,
.tool-card,
.build-card,
.journey-card,
.api-card,
.api-method-card,
.api-example-card,
.api-task-card,
.api-challenge-card,
.api-path-card,
.api-lesson-card,
.track-intro-card,
.hero-signal-card,
.scenario-card,
.runbook-card,
.qa-card,
.detail-card,
.roadmap-card,
.project-card,
.projects-checklist article {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.home-card,
.snapshot-card,
.content-card,
.tool-card,
.build-card,
.journey-card,
.api-card,
.api-method-card,
.api-example-card,
.api-task-card,
.api-challenge-card,
.api-path-card,
.api-lesson-card,
.track-intro-shell,
.table-wrap,
.story-table-wrap,
.api-table-wrap,
.projects-panel,
.project-card,
.python-panel,
.topic-hero,
.topic-panel,
.topic-card,
.topic-rail-card,
.ctv2-panel,
.ctv2-card,
.ctv2-section-card,
.ctv2-debug-card,
.ctv2-platform,
.ctv2-final,
.lab-header,
.lab-section,
.privacy-panel,
.privacy-summary-card,
.privacy-law-card,
.privacy-sidebar {
    border-radius: var(--site-polish-radius);
}

.build-card,
.journey-card,
.topic-card,
.topic-rail-card,
.ctv2-card,
.ctv2-platform,
.ctv2-debug-card,
.privacy-summary-card,
.privacy-law-card,
.lab-section {
    box-shadow: var(--site-polish-shadow);
}

.home-button,
.about-btn,
.api-btn,
.projects-btn,
.project-card__link,
.python-btn,
.topic-btn,
.topic-related a,
.ctv2-btn,
.btn-solid,
.btn-ghost,
.test-button,
.api-copy-btn,
.api-reveal-btn,
.api-preset-btn,
.api-lab-load-btn,
.ref-pill {
    min-height: var(--site-polish-pill-height);
    border-radius: 999px !important;
    font-weight: 800;
}

.hero-eyebrow,
.section-kicker,
.story-section-kicker,
.about-kicker,
.api-kicker,
.projects-kicker,
.project-card__eyebrow,
.projects-section__eyebrow,
.python-kicker,
.topic-kicker,
.topic-section__eyebrow,
.ctv2-eyebrow,
.ctv2-section-kicker,
.api-badge,
.api-step-pill,
.api-method-tag,
.topic-map-tag,
.pill,
.badge,
.ctv2-tag {
    border-radius: 999px !important;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.pill,
.badge {
    letter-spacing: 0.06em !important;
}

.site-brand__mark,
.signal-icon,
.ctv2-icon-wrap,
.ctv2-platform-badge,
.journey-step,
.privacy-summary-card > span:first-child,
.icon {
    flex-shrink: 0;
    box-sizing: border-box;
}

.site-brand__mark,
.signal-icon,
.ctv2-icon-wrap,
.ctv2-platform-badge,
.journey-step,
.privacy-summary-card > span:first-child {
    width: var(--site-polish-icon-size);
    height: var(--site-polish-icon-size);
}

.topic-map-card .text-link,
.api-inline-link,
.project-card__link {
    margin-top: auto;
    align-self: flex-start;
}

.button-row,
.about-actions,
.hero-actions,
.api-hero-actions,
.api-task-actions,
.projects-actions,
.python-actions,
.python-link-row,
.topic-actions,
.topic-related,
.ctv2-actions,
.ctv2-final-actions,
.ref-row {
    align-items: center;
}

.flow-diagram,
.story-table-wrap,
.table-wrap,
.api-table-wrap {
    box-shadow: var(--site-polish-shadow);
}

.projects-section,
.python-section,
.about-section,
.api-section,
.table-section,
.scenarios-section,
.runbook-section,
.journey-section,
.qa-section,
.references-section,
.details-section,
.roadmap-section {
    scroll-margin-top: calc(var(--site-header-height, 96px) + 20px);
}

@media (max-width: 1100px) {
    .snapshot-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .tool-grid,
    .journey-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .build-grid,
    .two-column-grid,
    .projects-hero,
    .python-hero,
    .about-hero__grid,
    .api-hero-grid,
    .hero-grid,
    .flow-wrap,
    .story-example-grid {
        grid-template-columns: 1fr !important;
    }

    .site-header__inner,
    .site-footer__inner,
    .au-home .container,
    .about-portfolio .container,
    .learning-page .container,
    .api-hub .container,
    .projects-shell .container,
    .ctv-shell .container,
    .lab-container,
    .privacy-shell .container,
    .python-shell .container,
    .topic-shell .container,
    .projects-wrap,
    .python-wrap,
    .blog-page .blog-wrap,
    .blog-page .article-wrap {
        width: min(var(--site-shell-width), 100%) !important;
    }
}

@media (max-width: 767px) {
    :root {
        --site-shell-gutter: 1rem;
    }

    .site-header__inner,
    .site-footer__inner {
        padding-inline: 1rem;
    }

    .projects-wrap,
    .python-wrap,
    .blog-page .blog-wrap,
    .blog-page .article-wrap {
        padding-top: 28px !important;
        padding-bottom: 56px !important;
    }

    .button-row > *,
    .about-actions > *,
    .hero-actions > *,
    .projects-actions > *,
    .python-actions > *,
    .python-link-row > *,
    .api-hero-actions > *,
    .topic-actions > *,
    .topic-related > *,
    .ctv2-actions > *,
    .ctv2-final-actions > *,
    .ref-row > *,
    .blog-page .link-row > * {
        flex: 1 1 100%;
    }

    .blog-page .quick-nav {
        display: grid;
    }

    .blog-page :is(.link-btn, .blog-link) {
        width: 100%;
    }

    .snapshot-grid,
    .tool-grid,
    .build-grid,
    .journey-grid,
    .stats-grid,
    .lab-grid,
    .qa-grid {
        grid-template-columns: 1fr !important;
    }

    .story-table,
    .api-table,
    .table-wrap table {
        min-width: 540px;
    }
}

/* Site-wide: reduce clipped text on glass cards (premium uses overflow:hidden) */
.hub-hero-card,
.flow-card,
.topic-map-card-link,
.story-code-card {
    overflow-x: clip !important;
    overflow-y: visible !important;
}

main :is(h1, h2, h3, h4, h5, h6) {
    overflow-wrap: break-word;
    word-wrap: break-word;
}

#adtech-react-root {
    min-width: 0;
    box-sizing: border-box;
}

.lab-header h1,
.lab-header p,
.lab-section .section-title {
    overflow-wrap: break-word;
}
