/* --- AI Optimized System Variables --- */
:root {
    --bg-color: #f2eee5;
    --paper-color: #fdfcf9;
    --text-main: #1e272e;
    --accent-sage: #355c5c;
    --accent-earth: #2d4635;
    --line-tight: rgba(53, 92, 92, 0.25);
    --shadow-sharp: 0 15px 50px rgba(0, 0, 0, 0.08);
}

/* --- Base Engine --- */
body {
    background-color: var(--bg-color);
    background-image:
        radial-gradient(var(--accent-sage) 0.5px, transparent 0.5px),
        radial-gradient(var(--accent-sage) 0.5px, var(--bg-color) 0.5px);
    background-size: 30px 30px;
    background-position: 0 0, 15px 15px;
    background-attachment: fixed;
    color: var(--text-main);
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Helvetica Neue", "Arial", sans-serif;
    line-height: 1.75;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "palt";
    letter-spacing: 0.03em;
}

/* --- Master Container --- */
.container {
    max-width: 800px;
    margin: 0 auto;
    background-color: var(--paper-color);
    border-left: 2px solid var(--accent-sage);
    border-right: 2px solid var(--accent-sage);
    border-top: 20px solid var(--accent-sage);
    outline: 1px solid var(--line-tight);
    outline-offset: -10px;
    box-shadow: var(--shadow-sharp);
    position: relative;
    padding: 80px 60px;
    min-height: 100vh;
    box-sizing: border-box;
}

/* Navigation Guide */
.container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 35px;
    bottom: 0;
    width: 1px;
    border-left: 1px dashed var(--accent-sage);
    opacity: 0.15;
}

.top-divider {
    color: var(--accent-sage);
    text-align: center;
    margin: -40px 0 60px 0;
    letter-spacing: 30px;
    opacity: 0.3;
    font-size: 20px;
    font-weight: bold;
}

/* --- Typography --- */
h1 {
    font-size: clamp(32px, 5.5vw, 48px);
    font-weight: 900;
    color: #1a252f;
    margin: 10px 0;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

.org-type {
    font-size: 15px;
    font-weight: 800;
    color: var(--accent-sage);
    letter-spacing: 0.5em;
    display: block;
    margin-bottom: 5px;
}

.domain-text {
    font-family: "Consolas", monospace;
    font-size: 16px;
    font-weight: bold;
    color: var(--accent-sage);
    letter-spacing: 0.25em;
    margin: 10px 0 40px 0;
    opacity: 0.9;
}

.catchphrase {
    font-size: clamp(16px, 2vw, 19px);
    font-weight: bold;
    color: var(--accent-earth);
    margin: 35px 0;
    border-top: 2px solid var(--line-tight);
    border-bottom: 2px solid var(--line-tight);
    padding: 20px 0;
    display: inline-block;
    width: 100%;
    text-align: center;
}

.header-tag {
    font-family: "Consolas", monospace;
    font-size: 10px;
    color: #7f8c8d;
    letter-spacing: 0.2em;
    margin-top: 40px;
    text-transform: uppercase;
    border: 1px solid var(--line-tight);
    padding: 5px 15px;
    display: inline-block;
}

h2 {
    font-size: clamp(20px, 3vw, 24px);
    background-color: var(--accent-sage);
    color: var(--paper-color);
    padding: 15px 30px;
    margin-top: 120px;
    margin-left: -60px;
    margin-right: -60px;
    border-left: 20px solid var(--accent-earth);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    font-weight: 900;
}

section {
    margin-bottom: 160px;
    text-align: justify;
    text-justify: inter-ideograph;
}

.important-point {
    font-weight: bold;
    border-left: 10px solid var(--accent-sage);
    padding: 20px 25px;
    background-color: #f4f7f0;
    margin: 35px 0;
}

/* --- Table Engineering --- */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 50px 0;
    border: 2px solid var(--accent-sage);
}

.info-table th {
    background-color: #f0f4ef;
    padding: 20px;
    font-size: 14px;
    color: var(--accent-earth);
    border: 1px solid var(--accent-sage);
    width: 25%;
    text-align: center;
}

.info-table td {
    padding: 20px;
    font-size: 17px;
    border: 1px solid var(--accent-sage);
    background-color: #ffffff;
}

.representative {
    font-size: 1.2em;
    font-weight: 900;
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-thickness: 2px;
}

/* --- Unified Center Alignment for GIFs --- */
.gif-container {
    text-align: center;
    margin: 40px 0;
}

.gif-container img {
    max-width: 100%;
    height: auto;
    display: inline-block;
}

.top-image {
    width: 480px;
    filter: contrast(105%);
}

.section-seal img {
    max-width: 260px;
    opacity: 0.95;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 100px 20px;
    background-color: #eaede3;
    border-top: 4px solid var(--accent-sage);
    font-size: 13px;
}

/* --- Responsive --- */
@media screen and (max-width: 1024px) {
    .container {
        max-width: 95%;
        padding: 80px 40px;
    }

    h2 {
        margin-left: -40px;
        margin-right: -40px;
    }
}

@media screen and (max-width: 767px) {
    .container {
        width: 100%;
        border: none;
        padding: 60px 20px;
        outline: none;
    }

    h2 {
        margin-left: -20px;
        margin-right: -20px;
        padding: 12px 20px;
        border-left-width: 15px;
    }

    .top-divider {
        letter-spacing: 15px;
    }

    .info-table th {
        width: 35%;
        padding: 15px 10px;
    }

    .br-mobile {
        display: inline;
    }
}

/* Cookie Banner */
#cookie-banner {
    display: none;
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 320px;
    background-color: var(--accent-earth);
    padding: 25px;
    border-radius: 8px;
    z-index: 9999;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* --- Hamburger Menu & Navigation --- */
/* --- Hamburger Menu & Navigation --- */
.menu-btn {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    background-color: transparent;
    /* Changed to transparent for a floating '≡' look */
    border: none;
    cursor: pointer;
    z-index: 10002;
    /* Top-most layer */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    transition: 0.3s;
}

.menu-btn span {
    display: block;
    width: 30px;
    height: 3px;
    background-color: var(--accent-sage);
    /* Themed color for the lines */
    border-radius: 2px;
    transition: 0.3s;
}

.menu-btn.active span {
    background-color: var(--accent-earth);
    /* Color change when active */
}

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

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

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

.side-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: min(350px, 80%);
    height: 100vh;
    background-color: var(--paper-color);
    border-left: 8px solid var(--accent-sage);
    box-shadow: -15px 0 40px rgba(0, 0, 0, 0.15);
    z-index: 10001;
    transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
}

.side-menu.active {
    right: 0;
}

.menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: 0.4s;
}

.menu-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Blur Effect for Background Content */
body.menu-active .container,
body.menu-active #bgm-control,
body.menu-active #cookie-banner,
body.menu-active footer {
    filter: blur(8px);
    pointer-events: none;
    transition: filter 0.4s ease;
}

/* Ensuring smooth transition when removing blur */
.container,
#bgm-control,
#cookie-banner,
footer {
    transition: filter 0.4s ease;
}

.menu-content {
    padding: 100px 40px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.menu-header {
    font-size: 12px;
    letter-spacing: 0.3em;
    color: var(--accent-sage);
    font-weight: 800;
    margin-bottom: 40px;
    opacity: 0.6;
}

.menu-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-links li {
    margin-bottom: 30px;
}

.menu-links a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 20px;
    font-weight: 900;
    transition: 0.3s;
    display: block;
}

.menu-links a:hover {
    color: var(--accent-sage);
    padding-left: 10px;
}

.menu-footer {
    margin-top: auto;
    font-size: 11px;
    color: #7f8c8d;
    letter-spacing: 0.05em;
}

@media screen and (max-width: 767px) {
    .menu-btn {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }

    .side-menu {
        width: 85%;
    }
}

/* --- Page Transitions --- */
.page-view {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease-in-out;
}

.page-view.active {
    display: block;
    opacity: 1;
}

.fade-out {
    opacity: 0 !important;
}

.fade-in {
    opacity: 1 !important;
}

/* BGM Control */
#bgm-control {
    position: fixed;
    bottom: 25px;
    left: 25px;
    z-index: 9998;
}

#bgm-toggle {
    background-color: var(--paper-color);
    border: 2px solid var(--accent-sage);
    color: var(--accent-sage);
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 800;
    font-size: 14px;
    cursor: pointer;
    box-shadow: var(--shadow-sharp);
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

#bgm-toggle::before {
    content: "♪";
    font-size: 16px;
}

#bgm-toggle:hover {
    background-color: var(--accent-sage);
    color: white;
}

#bgm-toggle.off {
    border-color: #7f8c8d;
    color: #7f8c8d;
    opacity: 0.7;
}

#bgm-toggle.off::before {
    content: "×";
    color: #e74c3c;
}

@media screen and (max-width: 767px) {
    #bgm-control {
        bottom: 20px;
        left: 20px;
    }
}