/**************************************************************************/
/** Reset & Base
/**************************************************************************/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    height: 100%;
    background-color: #000;
    color: #fff;
    font-family: 'Segoe UI', Arial, sans-serif;
}

a {
    outline: none;
    border: none;
    text-decoration: none;
}

a, a:visited {
    color: rgba(255, 255, 255, 0.7);
}

a:hover {
    color: rgba(255, 255, 255, 1);
}

:focus-visible {
    outline: none;
}


/**************************************************************************/
/** Variables
/**************************************************************************/

:root {
    --header-height: 7rem;

    /* Theme colors — dark defaults */
    --color-bg:             #000;
    --color-bg-alt:         #0a0a0a;
    --color-text:           #fff;
    --color-text-heading:   rgba(255, 255, 255, 0.9);
    --color-text-muted:     rgba(255, 255, 255, 0.6);
    --color-text-bold:      rgba(255, 255, 255, 0.95);
    --color-link:           rgba(255, 255, 255, 0.7);
    --color-link-hover:     rgba(255, 255, 255, 1);
    --color-border:         rgba(255, 255, 255, 0.08);
    --color-border-medium:  rgba(255, 255, 255, 0.1);
    --color-border-subtle:  rgba(255, 255, 255, 0.12);
    --color-border-strong:  rgba(255, 255, 255, 0.15);
    --color-code-text:      #e0a0b0;
    --color-code-bg:        rgba(255, 255, 255, 0.08);
    --color-pre-bg:         rgba(255, 255, 255, 0.05);
    --color-table-header:   rgba(255, 255, 255, 0.08);
    --color-table-alt:      rgba(255, 255, 255, 0.03);
}

.theme-light {
    --color-bg:             #fff;
    --color-bg-alt:         #f5f5f5;
    --color-text:           #1a1a1a;
    --color-text-heading:   rgba(0, 0, 0, 0.85);
    --color-text-muted:     rgba(0, 0, 0, 0.55);
    --color-text-bold:      rgba(0, 0, 0, 0.9);
    --color-link:           #2a5da8;
    --color-link-hover:     #1a3d6e;
    --color-border:         rgba(0, 0, 0, 0.08);
    --color-border-medium:  rgba(0, 0, 0, 0.1);
    --color-border-subtle:  rgba(0, 0, 0, 0.12);
    --color-border-strong:  rgba(0, 0, 0, 0.15);
    --color-code-text:      #9b3a50;
    --color-code-bg:        rgba(0, 0, 0, 0.05);
    --color-pre-bg:         rgba(0, 0, 0, 0.03);
    --color-table-header:   rgba(0, 0, 0, 0.06);
    --color-table-alt:      rgba(0, 0, 0, 0.02);
}


/**************************************************************************/
/** Header (always dark)
/**************************************************************************/

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2rem 3rem;
    height: var(--header-height);
    background-color: #000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

header h1 {
    line-height: 0;
    margin: 0;
    padding: 0;
    border: 0 none;
}

header h1 a {
    display: inline-block;
}

.logo {
    height: 3rem;
    width: auto;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.9;
}


/**************************************************************************/
/** Menu Button (Mobile — always dark)
/**************************************************************************/

.menu-button {
    width: 53px;
    height: 53px;
    position: absolute;
    right: 0;
    z-index: 3;
    opacity: 0;
    cursor: pointer;
}

.menu-button-container {
    height: 30px;
    width: 30px;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 43px;
}

.menu-button-icon,
.menu-button-icon::before,
.menu-button-icon::after {
    display: block;
    background-color: rgba(255, 255, 255, 0.6);
    position: absolute;
    height: 2px;
    width: 24px;
    transition: transform 400ms cubic-bezier(0.23, 1, 0.32, 1);
}

.menu-button-icon::before {
    content: '';
    margin-top: -8px;
}

.menu-button-icon::after {
    content: '';
    margin-top: 8px;
}


/**************************************************************************/
/** Tabs / Navigation (always dark)
/**************************************************************************/

.tabbar {
    display: inline-block;
    float: right;
    position: relative;
    overflow: hidden;
}

.tabbar input {
    cursor: pointer;
}

.tabs a {
    text-decoration: none;
}

.tabs a div {
    display: inline-block;
    padding: 35px 35px 0;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    font-weight: 300;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.2s;
    cursor: pointer;
}

.tabs a div:hover {
    color: rgba(255, 255, 255, 0.9);
}

.tabs a div.active {
    color: rgba(255, 255, 255, 0.9);
}

.tabs a div.active:after,
.tabs a div:after {
    content: '';
    position: relative;
    width: 0;
    height: 1px;
    display: block;
    margin-top: 4px;
    right: 0;
    background: rgba(255, 255, 255, 0.7);
    transition: width .15s ease;
    -webkit-transition: width .15s ease;
}

.tabs a div.active:after {
    width: 100%;
}

.tabs a div:hover:after {
    width: 100%;
    left: 0;
    opacity: 0.5;
}


/**************************************************************************/
/** Main Content Area (themed)
/**************************************************************************/

@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

main {
    min-height: calc(100vh - var(--header-height) - 1px);
    background-color: var(--color-bg);
    color: var(--color-text);
    animation: fade-in 0.3s ease;
}

main a, main a:visited {
    color: var(--color-link);
}

main a:hover {
    color: var(--color-link-hover);
}

.content {
    padding: 2rem 3rem;
}


/**************************************************************************/
/** Homepage Hero
/**************************************************************************/

.hero-bg {
    height: calc(100vh - var(--header-height) - 1px);
    background: url('/images/bg.webp') center center / contain no-repeat;
    background-color: #000;
}


/**************************************************************************/
/** Typography (themed)
/**************************************************************************/

main h1, main h2, main h3 {
    font-weight: 300;
    color: var(--color-text-heading);
}

main h1 {
    font-size: 2rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border-strong);
}

h2 {
    font-size: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
}

h3 {
    font-size: 1.15rem;
    margin-top: 1.25rem;
    margin-bottom: 0.25rem;
}

p {
    margin-top: 0;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}


/**************************************************************************/
/** Content Styling (themed)
/**************************************************************************/

.content b, .content strong {
    color: var(--color-text-bold);
}

.content code {
    background-color: var(--color-code-bg);
    border: 1px solid var(--color-border-subtle);
    border-radius: 3px;
    padding: 1px 5px;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--color-code-text);
}

.content pre {
    background-color: var(--color-pre-bg);
    border: 1px solid var(--color-border-medium);
    border-radius: 4px;
    padding: 12px 15px;
    margin: 15px 0;
    overflow-x: auto;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

.content pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.content ul, .content ol {
    margin-left: 1.25rem;
    margin-bottom: 1rem;
}

.content li {
    line-height: 1.6;
    padding: 2px 0;
}

.content table {
    border-collapse: collapse;
    margin: 10px 0 20px;
}

.content table th,
.content table td {
    border: 1px solid var(--color-border-strong);
    padding: 8px 12px;
    text-align: left;
}

.content table th {
    background-color: var(--color-table-header);
    font-weight: 600;
}

.content table tr:nth-child(even) {
    background-color: var(--color-table-alt);
}


/**************************************************************************/
/** Mobile: Slide-in Menu (always dark)
/**************************************************************************/

@media (min-width: 1px) {

  /*
   * Hide tabs and show menu button
   */
    .tabs {
        display: none;
    }

    .menu-button, .menu-button-container {
        display: block;
    }


  /*
   * Position tabbar as full-screen overlay anchor
   */
    .tabbar {
        overflow: initial;
        position: absolute;
        width: 100%;
        height: var(--header-height);
        top: 0;
        left: 0;
    }

    .menu-button-container {
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .menu-button-icon {
        position: relative;
    }

    .menu-button {
        top: 0;
        height: var(--header-height);
    }

    .tabs {
        position: absolute;
        background: #0a0a0a;

        /* Hide the menu off-screen to the right */
        right: -100%;
        -webkit-transition: right 0.3s ease;
        -o-transition: right 0.3s ease;
        transition: right 0.3s ease;
        top: var(--header-height);
        display: inline-block;
        width: 0px;
        height: 100%;
        overflow-x: hidden;
    }

    .tabs a div {
        padding: 0 30px;
        font-size: 1.1rem;
        width: 100%;
        background: #111;
        line-height: 50px;
        height: 50px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.6);
        text-align: left;
    }

    .tabs a div.active {
        background: rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.9);
    }

    .tabs a div.active:after,
    .tabs a div:after {
        height: 0px;
    }

    .tabs a div:hover {
        background: rgba(255, 255, 255, 0.05);
        color: rgba(255, 255, 255, 0.9);
    }

    /*
     * Slide the menu in from the right when the input is checked
     */
    .tabbar input:checked ~ .tabs {
        right: 0;
        width: 100%;
        height: calc(100vh - var(--header-height));
        background-color: #0a0a0a;
        z-index: 2;
    }

    header {
        padding: 1.5rem;
    }

    .content {
        padding: 1.5rem;
    }
}


/**************************************************************************/
/** Desktop: Show tabs, hide hamburger
/**************************************************************************/

@media (min-width: 620px) {

  /*
   * Show tabs and hide menu button
   */
    .tabs {
        display: block;
    }

    .menu-button, .menu-button-container {
        display: none;
    }


  /*
   * Reset everything that was changed above
   */
    .tabbar {
        position: relative;
        overflow: initial;
        width: initial;
        height: initial;
        display: flex;
        align-items: center;
    }

    .tabs {
        display: flex;
        gap: 2rem;
        width: initial;
        overflow: initial;
        position: initial;
        height: initial;
        background: initial;
    }

    .tabs a div {
        display: inline-block;
        padding: 0;
        padding-bottom: 0.25rem;
        font-size: 0.85rem;
        background: none;
        width: initial;
        line-height: initial;
        height: initial;
        border: none;
        border-bottom: none;
        color: rgba(255, 255, 255, 0.6);
        text-align: initial;
    }

    .tabs a div.active {
        background: none;
        color: rgba(255, 255, 255, 0.9);
    }

    .tabs a div.active:after,
    .tabs a div:after {
        height: 1px;
    }

    .tabs a div:hover {
        background: none;
    }

    .tabbar input:checked ~ .tabs {
        background-color: initial;
    }

    header {
        padding: 2rem 3rem;
    }

    .content {
        padding: 2rem 3rem;
    }
}
