:root {
    --page-bg: #efeff1;
    --header-bg: #26231f;
    --header-border: #38312a;
    --text-light: #ffffff;
    --muted-light: #ddd6ca;
    --accent: #e48a32;
    --search-bg: #f8f5f0;
    --search-text: #928978;
    --hero-tint: rgba(98, 74, 42, 0.42);
    --hero-fallback-a: #b7a083;
    --hero-fallback-b: #8a755d;
    --surface: #f7f1e8;
    --surface-strong: #efe4d6;
    --surface-border: rgba(67, 49, 28, 0.14);
    --shadow-soft: 0 18px 40px rgba(38, 28, 20, 0.12);
}

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

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
}

html {
    overflow-x: hidden;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100svh;
    padding: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    background: var(--page-bg);
    color: #1f1a16;
}

/* Global Heading Styles - Consistent across all pages */
h1 {
    margin: 0.67em 0;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    margin: 0.75em 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

h3 {
    margin: 0.83em 0;
    font-size: 1.17rem;
    font-weight: 700;
    line-height: 1.3;
}

h4 {
    margin: 1em 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
}

h5 {
    margin: 1.17em 0;
    font-size: 0.83rem;
    font-weight: 700;
    line-height: 1.4;
}

h6 {
    margin: 1.33em 0;
    font-size: 0.67rem;
    font-weight: 700;
    line-height: 1.4;
}

.page-shell {
    width: 100%;
    max-width: 100vw;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
}

main {
    display: block;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    padding: 10px 22px;
    background: var(--header-bg);
    border: 1px solid var(--header-border);
    color: var(--text-light);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.brand-mark {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    display: grid;
    place-items: center;
    position: relative;
    flex-shrink: 0;
}

.brand-mark::before {
    content: "";
    position: absolute;
    inset: 6px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
}

.brand-mark-core {
    position: relative;
    z-index: 1;
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    color: var(--muted-light);
}

.brand-copy {
    min-width: 0;
}

.brand-title,
.brand-tagline {
    margin: 0;
}

.brand-title {
    font-size: 1.55rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
}

.brand-accent {
    color: var(--accent);
}

.brand-tagline {
    margin-top: 3px;
    max-width: 240px;
    color: var(--muted-light);
    font-size: 0.64rem;
    line-height: 1.2;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-nav {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 22px;
    flex-wrap: wrap;
}

.site-nav a {
    color: var(--text-light);
    font-size: 0.98rem;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    transition: color 0.2s ease;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.site-nav a:hover {
    color: var(--accent);
}

.site-nav a:hover::after {
    transform: scaleX(1);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

.search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 190px;
    padding: 6px 14px;
    background: var(--search-bg);
    border-radius: 999px;
}

.search-icon {
    width: 12px;
    height: 12px;
    border: 2px solid #b6ad9f;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.search-icon::after {
    content: "";
    position: absolute;
    right: -5px;
    bottom: -3px;
    width: 7px;
    height: 2px;
    background: #b6ad9f;
    border-radius: 999px;
    transform: rotate(45deg);
    transform-origin: center;
}

.search-form input {
    width: 100%;
    border: 0;
    padding: 0;
    background: transparent;
    color: var(--search-text);
    font: inherit;
    outline: none;
}

.search-form input::placeholder {
    color: var(--search-text);
}

.menu-button {
    display: grid;
    align-content: space-between;
    width: 40px;
    height: 40px;
    padding: 10px 8px;
    border: 0;
    background: transparent;
    cursor: pointer;
    flex: 0 0 40px;
}

.menu-button span {
    display: block;
    width: 100%;
    height: 3px;
    border-radius: 999px;
    background: var(--text-light);
}
.header-actions {
    position: relative;  /* Make this the positioning context */
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #1a1a1a;  /* Dark opaque background */
    border: 1px solid rgba(228, 138, 50, 0.3);
    border-radius: 8px;
    min-width: 200px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    margin-top: 8px;
    backdrop-filter: blur(10px);  /* Optional: adds glass effect */
}

.dropdown-content.active {
    display: flex;
    flex-direction: column;
}

.dropdown-content a {
    color: var(--text-light);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid rgba(228, 138, 50, 0.1);
}

.dropdown-content a:last-child {
    border-bottom: none;
}

.dropdown-content a:hover {
    background-color: rgba(228, 138, 50, 0.2);
    color: var(--accent);
}

.site-footer {
    width: 100%;
    background: #26211d;
    background-color: #26211d;
    color: #f4ede4;
    position: relative;
    z-index: 10;
}

.search-hero,
.search-results-section {
    padding: 32px 20px 0;
}

.search-shell {
    width: min(1100px, 100%);
    margin: 0 auto;
}

.section-kicker {
    margin: 0 0 12px;
    color: #8c6136;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.search-hero .search-shell {
    padding: 34px;
    background:
        linear-gradient(135deg, rgba(228, 138, 50, 0.2), rgba(255, 255, 255, 0.8)),
        radial-gradient(circle at top right, rgba(128, 91, 48, 0.24), transparent 36%),
        var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 28px;
    box-shadow: var(--shadow-soft);
}

.search-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.05;
}

.search-lead {
    max-width: 720px;
    margin: 14px 0 0;
    color: #56483a;
    font-size: 1.02rem;
    line-height: 1.7;
}

.search-summary-bar {
    margin-top: 24px;
    padding: 18px 22px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(67, 49, 28, 0.1);
    border-radius: 20px;
}

.search-summary-bar p {
    margin: 0;
    color: #45382c;
    font-size: 0.96rem;
    font-weight: 600;
}

.search-results-list {
    display: grid;
    gap: 18px;
    margin: 22px 0 42px;
}

.search-result-card,
.search-empty {
    padding: 24px;
    background: rgba(255, 249, 242, 0.92);
    border: 1px solid rgba(67, 49, 28, 0.12);
    border-radius: 24px;
    box-shadow: 0 14px 28px rgba(35, 25, 16, 0.08);
}

.search-result-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.search-result-category {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    background: rgba(228, 138, 50, 0.14);
    border-radius: 999px;
    color: #8a5421;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.search-result-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.search-result-tags li {
    padding: 6px 10px;
    background: rgba(62, 42, 24, 0.06);
    border-radius: 999px;
    color: #5f4b38;
    font-size: 0.82rem;
}

.search-result-card h2 {
    margin: 16px 0 8px;
    font-size: 1.35rem;
}

.search-result-card h2 a,
.search-result-link {
    color: #2a2118;
    text-decoration: none;
}

.search-result-card h2 a:hover,
.search-result-link:hover {
    color: #b5661f;
}

.search-result-summary,
.search-result-snippet,
.search-empty p {
    margin: 0;
    color: #56483a;
    line-height: 1.7;
}

.search-suggestion {
    margin-bottom: 10px;
    font-weight: 600;
}

.search-suggestion a {
    color: #9b571b;
    text-decoration: underline;
    text-underline-offset: 0.18em;
}

.search-result-snippet {
    margin-top: 12px;
}

.search-result-link {
    display: inline-flex;
    margin-top: 16px;
    font-weight: 700;
}

mark {
    padding: 0 0.16em;
    background: rgba(228, 138, 50, 0.26);
    color: inherit;
    border-radius: 0.25em;
}

.search-empty h2 {
    margin: 0 0 8px;
}

.footer-shell {
    padding: 34px 20px 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.65fr) minmax(180px, 1fr) minmax(180px, 1fr);
    gap: 32px;
    align-items: start;
}

.footer-brand-block {
    max-width: 430px;
}

.footer-brand,
.footer-intro,
.footer-description,
.footer-bottom p,
.footer-links,
.footer-contact-list {
    margin: 0;
}

.footer-brand {
    font-size: 1.9rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.03em;
}

.footer-intro {
    margin-top: 8px;
    max-width: 300px;
    color: #d4c8bd;
    font-size: 0.98rem;
    line-height: 1.45;
}

.footer-description {
    margin-top: 14px;
    max-width: 360px;
    color: #bcae9f;
    font-size: 0.96rem;
    line-height: 1.6;
}

.footer-contact-list,
.footer-links {
    padding: 0;
    list-style: none;
}

.footer-contact-list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.footer-contact-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #e5dbd1;
    font-size: 0.95rem;
    line-height: 1.5;
}

.footer-contact-icon {
    width: 18px;
    height: 18px;
    color: #f0e7de;
    flex: 0 0 18px;
    margin-top: 2px;
}

.footer-contact-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.footer-contact-list a,
.footer-links a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

.footer-contact-list a {
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
}

.footer-contact-list a:hover,
.footer-links a:hover {
    color: var(--accent);
}

.footer-column h2 {
    margin: 0 0 14px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 700;
}

.footer-links {
    display: grid;
    gap: 10px;
}

.footer-links a {
    color: #d0c2b5;
    font-size: 0.95rem;
    line-height: 1.45;
}

.footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 30px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.footer-bottom p {
    color: #bcae9f;
    font-size: 0.9rem;
    line-height: 1.5;
}

.footer-legal {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 26px;
    flex-wrap: wrap;
}

.footer-legal-item {
    position: relative;
}

.footer-legal-label {
    display: inline-flex;
    align-items: center;
    appearance: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: #d4c8bd;
    font-size: 0.95rem;
    font-family: inherit;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
    transition: color 0.2s ease;
}

.footer-legal-label:focus {
    outline: 2px solid rgba(228, 138, 50, 0.7);
    outline-offset: 4px;
    border-radius: 6px;
}

.footer-legal-item:hover .footer-legal-label,
.footer-legal-item:focus-within .footer-legal-label {
    color: var(--accent);
}

.footer-legal-card {
    position: absolute;
    left: 0;
    bottom: calc(100% + 14px);
    width: min(320px, calc(100vw - 40px));
    padding: 14px 16px;
    background: #fff9f2;
    border: 1px solid rgba(72, 53, 31, 0.16);
    border-radius: 14px;
    box-shadow: 0 18px 38px rgba(12, 8, 5, 0.26);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 30;
}

.footer-legal-card::after {
    content: "";
    position: absolute;
    left: 18px;
    top: 100%;
    width: 12px;
    height: 12px;
    background: #fff9f2;
    border-right: 1px solid rgba(72, 53, 31, 0.16);
    border-bottom: 1px solid rgba(72, 53, 31, 0.16);
    transform: rotate(45deg) translateY(-6px);
}

.footer-legal-item:hover .footer-legal-card,
.footer-legal-item:focus-within .footer-legal-card {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.footer-legal-card strong {
    display: block;
    margin-bottom: 6px;
    color: #2b2018;
    font-size: 0.95rem;
}

.footer-legal-card p {
    margin: 0;
    color: #4f4135;
    font-size: 0.88rem;
    line-height: 1.55;
}

@media (max-width: 900px) {
    .site-header {
        grid-template-columns: 1fr;
        justify-items: start;
    }

    .site-nav {
        justify-content: start;
        gap: 18px;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .search-form {
        flex: 1;
        max-width: 280px;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer-brand-block {
        max-width: none;
        grid-column: 1 / -1;
    }

    .footer-bottom {
        flex-direction: column;
        align-items: flex-start;
    }

    .footer-legal {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .site-header {
        gap: 16px;
        padding: 14px 16px;
    }

    .brand {
        align-items: flex-start;
    }

    .brand-title {
        font-size: 1.3rem;
    }

    .brand-tagline {
        max-width: 180px;
        font-size: 0.56rem;
    }

    .site-nav {
        gap: 14px;
    }

    .search-form {
        min-width: 0;
        max-width: none;
    }

    .search-hero,
    .search-results-section {
        padding: 24px 16px 0;
    }

    .search-hero .search-shell,
    .search-result-card,
    .search-empty {
        padding: 20px;
        border-radius: 20px;
    }

    .search-result-meta {
        align-items: flex-start;
    }

    .developers-section {
        padding: 34px 16px;
    }

    .developers-content-space {
        min-height: 260px;
        border-radius: 18px;
    }

    .footer-shell {
        padding: 30px 16px 20px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-brand {
        font-size: 1.7rem;
    }

    .footer-legal {
        gap: 16px;
    }

    .footer-legal-card {
        left: 50%;
        bottom: calc(100% + 12px);
        width: min(320px, calc(100vw - 32px));
        transform: translateX(-50%) translateY(10px);
    }

    .footer-legal-card::after {
        left: 50%;
        transform: translateX(-50%) rotate(45deg);
    }

    .footer-legal-item:hover .footer-legal-card,
    .footer-legal-item:focus-within .footer-legal-card {
        transform: translateX(-50%) translateY(0);
    }
}

/* Footer legal popovers must stay inside the viewport. */
.footer-legal,
.footer-legal-item {
    max-width: 100%;
    overflow: visible;
}

.footer-legal-card {
    box-sizing: border-box;
    max-width: calc(100vw - 32px);
    overflow-wrap: anywhere;
}

.footer-legal-item:last-child .footer-legal-card {
    left: auto;
    right: 0;
    transform: translateY(10px);
}

.footer-legal-item:last-child .footer-legal-card::after {
    left: auto;
    right: 28px;
}

.footer-legal-item:last-child:hover .footer-legal-card,
.footer-legal-item:last-child:focus-within .footer-legal-card {
    transform: translateY(0);
}

@media (max-width: 640px) {
    .footer-bottom {
        align-items: stretch;
    }

    .footer-legal {
        position: relative;
        width: 100%;
        justify-content: flex-start;
        gap: 12px 16px;
    }

    .footer-legal-item {
        position: static;
    }

    .footer-legal-label {
        white-space: normal;
    }

    .footer-legal-card {
        left: 0;
        right: auto;
        width: min(320px, calc(100vw - 32px));
        transform: translateY(10px);
    }

    .footer-legal-card::after {
        left: 24px;
        right: auto;
        transform: rotate(45deg) translateY(-6px);
    }

    .footer-legal-item:hover .footer-legal-card,
    .footer-legal-item:focus-within .footer-legal-card {
        transform: translateY(0);
    }

    .footer-legal-item:last-child .footer-legal-card {
        left: auto;
        right: 0;
        transform: translateY(10px);
    }

    .footer-legal-item:last-child .footer-legal-card::after {
        left: auto;
        right: 28px;
        transform: rotate(45deg) translateY(-6px);
    }

    .footer-legal-item:last-child:hover .footer-legal-card,
    .footer-legal-item:last-child:focus-within .footer-legal-card {
        transform: translateY(0);
    }
}
