
/* ==================================================
   Fool Factory
   Common CSS
================================================== */


/* ==================================================
   Theme
================================================== */

:root {
    --accent: #3b82f6;
    --accent-light: #93c5fd;
    --accent-dark: #2563eb;

    --accent-bg: #eff6ff;

    --text-main: #222;
    --text-heading: #111;
    --text-body: #444;
    --text-muted: #666;

    --border: #e3e3e3;
    --border-light: #eeeeee;

    --background: #fff;
    --background-subtle: #fafafa;
    --background-code: #f5f5f5;
}


/* ==================================================
   Reset
================================================== */

* {
    box-sizing: border-box;
}

html {
    margin: 0;
    padding: 0;

    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans JP",
        sans-serif;

    color: var(--text-main);
    background: var(--background);

    line-height: 1.8;

    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

a {
    color: var(--accent);

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

a:hover {
    color: var(--accent-dark);
}

button,
input,
textarea,
select {
    font: inherit;
}


/* ==================================================
   Header
================================================== */

.header {
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 64px;

    display: flex;
    align-items: center;

    background: rgba(255, 255, 255, 0.96);

    border-bottom: 1px solid var(--border);

    z-index: 1200;

    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}


/* Site name */

.site-name {
    margin-left: 20px;

    color: var(--accent);

    font-size: 20px;
    font-weight: 700;

    letter-spacing: 0.02em;

    text-decoration: none;

    transition:
        color 0.2s ease,
        opacity 0.2s ease;
}

.site-name:hover {
    color: var(--accent-dark);

    opacity: 1;
}


/* ==================================================
   Hamburger
================================================== */

.menu-button {
    width: 64px;
    height: 64px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border: none;
    background: transparent;

    cursor: pointer;
}

.menu-button:hover {
    background: var(--accent-bg);
}


.hamburger {
    width: 24px;
    height: 18px;

    display: flex;
    flex-direction: column;
    justify-content: space-between;
}


.hamburger span {
    display: block;

    width: 24px;
    height: 2px;

    background: var(--text-main);

    border-radius: 2px;

    transition:
        transform 0.25s ease,
        opacity 0.25s ease,
        background 0.25s ease;
}


.menu-button:hover .hamburger span {
    background: var(--accent);
}


/* Hamburger → X */

.menu-button.active .hamburger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-button.active .hamburger span:nth-child(2) {
    opacity: 0;
}

.menu-button.active .hamburger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}


/* ==================================================
   Side Menu
================================================== */

.side-menu {
    position: fixed;

    top: 0;
    left: 0;

    width: 280px;
    height: 100vh;

    padding-top: 80px;

    background: var(--background);

    border-right: 1px solid var(--border);

    transform: translateX(-100%);

    transition: transform 0.25s ease;

    z-index: 1100;

    overflow-y: auto;
}


.side-menu.open {
    transform: translateX(0);
}


.side-menu nav {
    display: flex;
    flex-direction: column;
}


.side-menu nav a {
    display: block;

    padding: 15px 24px;

    color: var(--text-main);

    font-size: 16px;
    font-weight: 500;

    text-decoration: none;

    border-bottom: 1px solid var(--border-light);

    transition:
        background 0.2s ease,
        padding-left 0.2s ease,
        color 0.2s ease;
}


.side-menu nav a:hover {
    color: var(--accent);

    background: var(--accent-bg);

    padding-left: 30px;
}


/* ==================================================
   Overlay
================================================== */

.overlay {
    position: fixed;

    top: 0;
    left: 0;

    width: 100%;
    height: 100vh;

    background: rgba(0, 0, 0, 0.4);

    opacity: 0;
    visibility: hidden;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;

    z-index: 1050;
}


.overlay.open {
    opacity: 1;
    visibility: visible;
}


/* ==================================================
   Main
================================================== */

main {
    min-height: calc(100vh - 140px);

    padding-top: 64px;
}


/* ==================================================
   Page Container
================================================== */

main > section,
.page-container {
    width: min(1100px, calc(100% - 48px));

    margin-left: auto;
    margin-right: auto;
}


/* ==================================================
   Hero
================================================== */

.hero {
    width: min(1100px, calc(100% - 48px));

    margin: 0 auto;

    padding:
        120px 0
        100px;
}


.hero h1 {
    margin: 0 0 18px;

    color: var(--accent);

    font-size: clamp(42px, 7vw, 76px);

    font-weight: 700;

    line-height: 1.1;

    letter-spacing: -0.03em;
}


.hero p {
    margin: 0;

    color: var(--text-muted);

    font-size: clamp(16px, 2vw, 20px);
}


/* ==================================================
   Sections
================================================== */

section {
    padding-top: 40px;
    padding-bottom: 80px;
}


section + section {
    border-top: 1px solid var(--border-light);
}


section h2 {
    margin:
        0 0 28px;

    color: var(--text-heading);

    font-size: 32px;

    font-weight: 700;

    line-height: 1.3;

    letter-spacing: -0.02em;

    border-left: 4px solid var(--accent);

    padding-left: 12px;
}


section h3 {
    margin:
        32px 0 12px;

    color: var(--text-main);

    font-size: 22px;

    font-weight: 650;

    line-height: 1.4;
}


section p {
    margin:
        0 0 20px;

    color: var(--text-body);

    font-size: 16px;
}


/* ==================================================
   Lead Text
================================================== */

.lead {
    max-width: 760px;

    color: var(--text-muted);

    font-size: 18px;

    line-height: 1.9;
}


/* ==================================================
   Links
================================================== */

main a:not(.site-name) {
    color: var(--accent);

    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}


main a:not(.site-name):hover {
    color: var(--accent-dark);

    opacity: 1;
}


/* ==================================================
   Cards
================================================== */

.card-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 24px;
}


.card {
    padding: 28px;

    background: var(--background-subtle);

    border: 1px solid var(--border);

    border-radius: 8px;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}


.card:hover {
    transform: translateY(-3px);

    border-color: var(--accent-light);

    box-shadow:
        0 8px 24px rgba(37, 99, 235, 0.08);
}


.card h3 {
    margin:
        0 0 12px;

    font-size: 20px;
}


.card p {
    margin: 0;

    color: var(--text-muted);

    font-size: 15px;
}


/* ==================================================
   Feature Cards
================================================== */

.feature-grid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 24px;
}


.feature {
    padding: 32px;

    border: 1px solid var(--border);

    border-radius: 8px;

    border-left: 3px solid var(--accent);

    background: var(--background);

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}


.feature:hover {
    border-color: var(--accent-light);

    border-left-color: var(--accent);

    box-shadow:
        0 6px 20px rgba(37, 99, 235, 0.06);
}


.feature h3 {
    margin-top: 0;
}


/* ==================================================
   Lists
================================================== */

main ul,
main ol {
    padding-left: 1.5em;
}


main li {
    margin-bottom: 8px;

    color: var(--text-body);
}


/* ==================================================
   Navigation / Explore List
================================================== */

.explore-list {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 12px 24px;

    padding: 0;

    list-style: none;
}


.explore-list li {
    margin: 0;
}


.explore-list a {
    display: block;

    padding: 18px 20px;

    color: var(--text-main);

    background: var(--background-subtle);

    border: 1px solid var(--border);

    border-radius: 6px;

    text-decoration: none;

    transition:
        background 0.2s ease,
        transform 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease;
}


.explore-list a:hover {
    color: var(--accent);

    background: var(--accent-bg);

    border-color: var(--accent-light);

    transform: translateY(-2px);
}


/* ==================================================
   Tags
================================================== */

.tags {
    display: flex;

    flex-wrap: wrap;

    gap: 8px;

    padding: 0;

    list-style: none;
}


.tags li {
    margin: 0;

    padding:
        5px 12px;

    color: var(--accent-dark);

    background: var(--accent-bg);

    border-radius: 999px;

    border: 1px solid var(--accent-light);

    font-size: 13px;
}


/* ==================================================
   Tables
================================================== */

.table-wrapper {
    width: 100%;

    overflow-x: auto;
}


main table {
    width: 100%;

    border-collapse: collapse;

    font-size: 15px;
}


main th,
main td {
    padding: 14px 16px;

    text-align: left;

    border-bottom: 1px solid var(--border);
}


main th {
    color: var(--text-main);

    background: var(--background-subtle);

    font-weight: 600;
}


/* ==================================================
   Code
================================================== */

main code {
    padding:
        2px 6px;

    color: var(--accent-dark);

    background: var(--accent-bg);

    border-radius: 4px;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 0.9em;
}


main pre {
    margin:
        24px 0;

    padding: 20px;

    overflow-x: auto;

    color: #333;

    background: var(--background-code);

    border: 1px solid var(--border);

    border-radius: 6px;

    line-height: 1.6;
}


main pre code {
    padding: 0;

    color: inherit;

    background: transparent;

    border-radius: 0;
}


/* ==================================================
   Network / Diagram Container
================================================== */

.diagram {
    width: 100%;

    padding: 24px;

    overflow-x: auto;

    background: var(--background-subtle);

    border: 1px solid var(--border);

    border-radius: 8px;
}


.diagram svg {
    display: block;

    width: 100%;

    height: auto;

    min-width: 700px;
}


/* ==================================================
   Notice / Information Box
================================================== */

.info-box {
    margin:
        24px 0;

    padding: 20px 24px;

    background: var(--accent-bg);

    border-left: 4px solid var(--accent);

    border-radius: 4px;
}


.info-box p:last-child {
    margin-bottom: 0;
}


/* ==================================================
   Footer
================================================== */

.footer {
    margin-top: 40px;

    border-top: 1px solid var(--border);

    background: var(--background-subtle);
}


.footer-inner {
    width: min(1100px, calc(100% - 48px));

    margin: 0 auto;

    padding: 32px 0;

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 20px;
}


.footer-name {
    color: var(--accent);

    font-weight: 600;

    letter-spacing: 0.02em;
}


.footer-copy {
    color: #777;

    font-size: 13px;
}


/* ==================================================
   Utility
================================================== */

.text-muted {
    color: #777;
}


.text-small {
    font-size: 14px;
}


.text-center {
    text-align: center;
}


.mt-0 {
    margin-top: 0;
}


.mb-0 {
    margin-bottom: 0;
}


.mb-20 {
    margin-bottom: 20px;
}


.mb-40 {
    margin-bottom: 40px;
}


/* ==================================================
   Responsive
================================================== */

@media (max-width: 800px) {

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


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


    .explore-list {
        grid-template-columns: 1fr;
    }


    section h2 {
        font-size: 28px;
    }


    section h3 {
        font-size: 20px;
    }

}


@media (max-width: 600px) {

    .header {
        height: 56px;
    }


    .menu-button {
        width: 56px;
        height: 56px;
    }


    .site-name {
        margin-left: 12px;

        font-size: 18px;
    }


    .side-menu {
        width: 260px;
    }


    main {
        padding-top: 56px;
    }


    main > section,
    .page-container {
        width: calc(100% - 40px);
    }


    .hero {
        width: calc(100% - 40px);

        padding:
            90px 0
            70px;
    }


    .hero h1 {
        font-size: 44px;
    }


    .hero p {
        font-size: 16px;
    }


    section {
        padding-top: 30px;
        padding-bottom: 60px;
    }


    section h2 {
        margin-bottom: 22px;

        font-size: 26px;
    }


    .card,
    .feature {
        padding: 24px;
    }


    .footer-inner {
        width: calc(100% - 40px);

        padding:
            24px 0;

        flex-direction: column;

        align-items: flex-start;
    }

}


/* ==================================================
   Accessibility
================================================== */

.menu-button:focus-visible,
.side-menu a:focus-visible,
.site-name:focus-visible,
main a:focus-visible {
    outline: 2px solid var(--accent);

    outline-offset: 3px;
}

/* ==================================================
   Monitoring Screenshot
================================================== */

.monitoring-screenshot {
    width: 100%;

    padding: 16px;

    background: var(--background-subtle);

    border: 1px solid var(--border);

    border-radius: 8px;

    overflow: hidden;
}


.monitoring-screenshot img {
    display: block;

    width: 100%;
    height: auto;

    border-radius: 4px;
}
