:root {
    --font-sans: "Space Grotesk", "Avenir Next", "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", "SFMono-Regular", monospace;
    --bg: #f3ecde;
    --bg-soft: rgba(255, 251, 244, 0.78);
    --bg-strong: #fffdf8;
    --ink: #171516;
    --muted: #615851;
    --line: rgba(23, 21, 22, 0.12);
    --accent: #0a5cff;
    --accent-alt: #0b8f77;
    --accent-warm: #ff6b2c;
    --shadow: 0 22px 60px rgba(33, 25, 18, 0.12);
    --shadow-soft: 0 14px 34px rgba(33, 25, 18, 0.08);
    --radius-lg: 2rem 2rem 0.85rem 2rem;
    --radius-md: 1.35rem;
}

* {
    box-sizing: border-box;
}

html {
    font-family: var(--font-sans);
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(10, 92, 255, 0.16), transparent 28%),
        radial-gradient(circle at bottom right, rgba(255, 107, 44, 0.14), transparent 24%),
        linear-gradient(180deg, #f6f0e5 0%, #efe6d7 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(23, 21, 22, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(23, 21, 22, 0.03) 1px, transparent 1px);
    background-size: 2rem 2rem;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.28), transparent 80%);
    pointer-events: none;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

::selection {
    color: #fff;
    background: var(--accent);
}

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

[hidden] {
    display: none !important;
}

.page-shell {
    position: relative;
    z-index: 1;
    max-width: 72rem;
    margin: 0 auto;
    padding: 1rem 1rem 2.5rem;
}

.page-shell[data-mode="bang"] {
    --mode-accent: var(--accent);
}

.page-shell[data-mode="snap"] {
    --mode-accent: var(--accent-alt);
}

.skip-link-ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -3rem;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg-strong);
    text-decoration: none;
    font-family: var(--font-mono);
}

.skip-link:focus {
    top: 1rem;
}

.site-header {
    padding: 0;
}

.masthead {
    display: grid;
    gap: 0.6rem;
}

.eyebrow,
.pattern-tag,
.section-kicker,
.control-label,
.control-card label,
.site-footer,
.route-preview,
.shortcode-domain,
.shortcode-action {
    font-family: var(--font-mono);
}

.eyebrow,
.pattern-tag,
.section-kicker,
.control-label,
.control-card label {
    margin: 0;
    font-size: 0.78rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
}

.brand-row {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.blog-title {
    font-size: clamp(2.6rem, 8vw, 4.8rem);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: -0.04em;
}

.blog-title a {
    text-decoration: none;
}

.asterisk {
    color: var(--accent-warm);
    font-size: 0.5em;
}

.content {
    display: grid;
    gap: 1rem;
}

.panel {
    position: relative;
    overflow: hidden;
    padding: clamp(1.35rem, 3vw, 2rem);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--bg-soft);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.panel::before {
    content: "";
    position: absolute;
    inset: auto auto -3rem -3rem;
    width: 10rem;
    height: 10rem;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(10, 92, 255, 0.12), transparent 70%);
    pointer-events: none;
}

.hero {
    display: grid;
    gap: 0.9rem;
    padding: clamp(1rem, 2.6vw, 1.45rem);
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(255, 239, 228, 0.9)),
        var(--bg-soft);
}

.hero-header,
.shortcode-section,
.control-deck {
    position: relative;
    z-index: 1;
}

.hero-header {
    display: grid;
    gap: 0.25rem;
    justify-items: center;
    text-align: center;
}

.post-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 0.45rem;
    margin: 0;
    font-size: clamp(2.4rem, 7vw, 4.6rem);
    line-height: 1;
    letter-spacing: -0.05em;
}

.post-title a {
    text-decoration: none;
}

.hero-intro,
.section-heading p {
    margin: 0;
    max-width: 58ch;
    color: var(--muted);
    line-height: 1.6;
}

.hero-notes {
    display: grid;
    gap: 0.55rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hero-notes p {
    margin: 0;
    padding: 0.72rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.52);
    font-size: 0.78rem;
    line-height: 1.5;
}

kbd {
    padding: 0.15rem 0.4rem;
    border: 1px solid rgba(23, 21, 22, 0.18);
    border-bottom-width: 2px;
    border-radius: 0.45rem;
    background: rgba(255, 255, 255, 0.9);
    font-family: var(--font-mono);
    font-size: 0.9em;
}

.noscript-note {
    margin: 0 0 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(255, 107, 44, 0.3);
    border-radius: var(--radius-md);
    background: rgba(255, 107, 44, 0.12);
}

.control-deck {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
    max-width: 58rem;
    margin: 0 auto;
}

.search-form {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: stretch;
    padding: 0.62rem;
    border: 1px solid rgba(23, 21, 22, 0.12);
    border-radius: 1.75rem;
    background: rgba(255, 255, 255, 0.86);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.search-form:focus-within {
    border-color: rgba(10, 92, 255, 0.32);
    box-shadow:
        0 0 0 4px rgba(10, 92, 255, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

#search-input,
#engine-select {
    width: 100%;
    border: 1px solid rgba(23, 21, 22, 0.12);
    border-radius: 1rem;
    background: rgba(255, 255, 255, 0.75);
    color: var(--ink);
}

#search-input {
    min-width: 0;
    border: 0;
    background: transparent;
    padding: 0.88rem 1rem;
    font-size: clamp(1.15rem, 2.4vw, 1.4rem);
}

#search-input:focus {
    outline: none;
}

#search-input::placeholder,
#engine-select::placeholder {
    color: rgba(23, 21, 22, 0.45);
}

#search-button {
    display: grid;
    place-items: center;
    width: 3.45rem;
    border: 0;
    border-radius: 1.15rem;
    background: linear-gradient(135deg, var(--accent), #083fdd);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 12px 26px rgba(10, 92, 255, 0.28);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

#search-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 16px 30px rgba(10, 92, 255, 0.24);
}

#search-button svg {
    width: 1.35rem;
    fill: currentColor;
}

.route-preview {
    width: 100%;
    min-height: 3rem;
    margin: 0;
    padding: 0.75rem 0.95rem;
    border-radius: 1rem;
    background: #161518;
    color: #f4ecde;
    font-size: 0.84rem;
    line-height: 1.5;
}

.hero-toolbar {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 0.7rem;
}

.control-inline,
.quick-starts {
    display: grid;
    width: 100%;
    min-width: 0;
    gap: 0.65rem;
    padding: 0.85rem;
    border: 1px solid var(--line);
    border-radius: 1.25rem;
    background: rgba(255, 255, 255, 0.62);
    box-shadow: var(--shadow-soft);
}

#engine-select,
.mode-button,
.example-chip,
.shortcode-row {
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

#engine-select {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0.8rem 0.9rem;
    appearance: none;
}

.mode-switch,
.example-chips {
    display: flex;
    width: 100%;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.mode-button,
.example-chip {
    border: 1px solid rgba(23, 21, 22, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    color: var(--ink);
    cursor: pointer;
}

.mode-button {
    flex: 1;
    min-width: 8rem;
    padding: 0.72rem 0.95rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.mode-button.is-active {
    border-color: transparent;
    background: var(--mode-accent);
    color: #fff;
    box-shadow: 0 12px 24px color-mix(in srgb, var(--mode-accent) 30%, transparent);
}

.example-chip {
    padding: 0.5rem 0.72rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.mode-button:hover,
.example-chip:hover,
.shortcode-row:hover {
    transform: translateY(-1px);
}

.shortcode-section h2 {
    margin: 0.3rem 0 0.65rem;
    font-size: clamp(1.5rem, 3vw, 2rem);
    line-height: 1.08;
}

.section-heading {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    justify-content: space-between;
    gap: 1rem 1.5rem;
}

.section-heading h2 {
    margin-top: 0.2rem;
}

.shortcode-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.35rem 1.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.shortcode-item {
    min-width: 0;
}

.shortcode-row,
.empty-state {
    width: 100%;
    border-radius: 0.9rem;
}

.shortcode-row {
    display: flex;
    align-items: baseline;
    gap: 0.65rem;
    padding: 0.42rem 0.5rem;
    border: 1px solid transparent;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.shortcode-row:hover,
.shortcode-row:focus-visible {
    background: rgba(255, 255, 255, 0.74);
    border-color: color-mix(in srgb, var(--mode-accent) 38%, rgba(23, 21, 22, 0.12));
    box-shadow: var(--shadow-soft);
}

.shortcode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.45rem;
    border-radius: 0.6rem;
    background: var(--mode-accent);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.74rem;
    white-space: nowrap;
}

.shortcode-name {
    min-width: 0;
    font-size: 0.92rem;
    line-height: 1.4;
}

.empty-state {
    display: grid;
    grid-column: 1 / -1;
    place-items: center;
    padding: 1.2rem;
    color: var(--muted);
}

.site-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.82rem;
    letter-spacing: 0.04em;
    color: var(--muted);
}

.site-footer p {
    margin: 0;
}

.back-to-top {
    display: inline-block;
    margin-left: 0.5rem;
    text-decoration-thickness: 0.08em;
    text-underline-offset: 0.16em;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 900px) {
    .hero-toolbar,
    .shortcode-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .page-shell {
        padding-inline: 0.8rem;
    }

    .page-shell::after {
        width: 7rem;
        height: 7rem;
    }

    .search-form {
        gap: 0.6rem;
        padding: 0.6rem;
    }

    .hero-notes {
        grid-template-columns: 1fr;
    }

    #search-button {
        width: 3.15rem;
    }
}
