/* Modern lightweight CSS reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #FFB4A2;
    --accent: #E5989B;
    --dark: #6D6875;
    --mid: #B5838D;
    --light: #FFCDB2;
    --deeper: #585264;
    --bg-top: #6D6875;
    --bg-bottom: #585264;
    --text-main: #FFCDB2;
    --surface: rgba(255, 205, 178, 0.06);
    --surface-strong: rgba(255, 180, 162, 0.13);
    --overlay: rgba(62, 57, 72, 0.48);
    --focus-ring: rgba(255, 180, 162, 0.55);
    --transition-theme: background-color 360ms ease, color 360ms ease, border-color 360ms ease;
}

body {
    min-height: 100vh;
    color: var(--text-main);
    font-family: "Noto Serif JP", system-ui, sans-serif;
    background:
        radial-gradient(circle at 20% 20%, rgba(255, 205, 178, 0.06), transparent 42%),
        radial-gradient(circle at 80% 80%, rgba(229, 152, 155, 0.05), transparent 40%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    overflow: hidden;
    transition: var(--transition-theme);
}

body[data-theme="light"] {
    --bg-top: #f7e3dc;
    --bg-bottom: #efd9cf;
    --text-main: #6D6875;
    --surface: rgba(109, 104, 117, 0.08);
    --surface-strong: rgba(181, 131, 141, 0.2);
    --overlay: rgba(123, 104, 112, 0.2);
    --focus-ring: rgba(181, 131, 141, 0.6);
}

@media (prefers-color-scheme: light) {
    body:not([data-theme]) {
        --bg-top: #f7e3dc;
        --bg-bottom: #efd9cf;
        --text-main: #6D6875;
        --surface: rgba(109, 104, 117, 0.08);
        --surface-strong: rgba(181, 131, 141, 0.2);
        --overlay: rgba(123, 104, 112, 0.2);
        --focus-ring: rgba(181, 131, 141, 0.6);
    }
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background-image: radial-gradient(rgba(255, 205, 178, 0.045) 0.6px, transparent 0.6px);
    background-size: 2px 2px;
    opacity: 0.22;
    pointer-events: none;
}

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.25rem;
    animation: fade-in 1.1s ease-out both;
}

.hero__inner {
    display: grid;
    gap: 0.72rem;
}

.hero__title {
    color: var(--light);
    font-size: clamp(3rem, 13vw, 8rem);
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.08em;
    animation: breathe 6.5s ease-in-out 1.1s infinite;
}

.hero__tagline {
    color: color-mix(in srgb, var(--text-main) 84%, transparent);
    font-size: clamp(0.8rem, 2.6vw, 1rem);
    letter-spacing: 0.2em;
    text-transform: lowercase;
}

.corner-controls {
    position: fixed;
    top: 0.85rem;
    right: 0.85rem;
    z-index: 25;
    display: flex;
    gap: 0.45rem;
}

.icon-toggle {
    width: 2rem;
    height: 2rem;
    border: 1px solid color-mix(in srgb, var(--text-main) 25%, transparent);
    background: color-mix(in srgb, var(--bg-bottom) 72%, transparent);
    color: var(--text-main);
    border-radius: 999px;
    font-family: "Noto Serif JP", system-ui, sans-serif;
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
    transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
}

.icon-toggle:hover,
.icon-toggle:focus-visible {
    outline: none;
    transform: translateY(-1px);
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--focus-ring) 45%, transparent);
}

.petals {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.bg-canvas {
    width: 100%;
    height: 100%;
    display: block;
    opacity: 0.56;
    transform: translateZ(0);
}

body[data-petals="off"] .petals {
    display: none;
}

.reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 700ms ease, transform 700ms ease;
    will-change: opacity, transform;
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes breathe {
    0%,
    100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.012);
    }
}

@media (max-width: 380px) {
    .hero__tagline {
        letter-spacing: 0.14em;
    }
}

.secret-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    opacity: 0;
    pointer-events: none;
    transition: opacity 300ms ease;
    z-index: 15;
}

.secret-menu {
    position: fixed;
    top: 0;
    right: 0;
    width: min(92vw, 28rem);
    height: 100vh;
    padding: 1.25rem;
    background: linear-gradient(180deg, rgba(88, 82, 100, 0.92), rgba(70, 64, 82, 0.95));
    border-left: 1px solid color-mix(in srgb, var(--text-main) 22%, transparent);
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateX(100%);
    pointer-events: none;
    transition: transform 320ms ease, opacity 320ms ease;
    z-index: 20;
}

.secret-menu__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.secret-menu__meta {
    font-size: 0.74rem;
    letter-spacing: 0.1em;
    margin-bottom: 0.75rem;
    color: color-mix(in srgb, var(--text-main) 75%, transparent);
}

.secret-menu__hint {
    color: rgba(255, 205, 178, 0.8);
    letter-spacing: 0.14em;
    font-size: 0.72rem;
    text-transform: lowercase;
}

.secret-menu__close {
    border: 0;
    background: transparent;
    color: var(--text-main);
    font-family: "Noto Serif JP", system-ui, sans-serif;
    font-size: 0.82rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: 0.4rem;
}

.secret-menu__close:hover,
.secret-menu__close:focus-visible {
    outline: none;
    background: rgba(255, 180, 162, 0.14);
}

.secret-menu__grid {
    display: grid;
    gap: 0.7rem;
    align-content: start;
}

.secret-card {
    text-decoration: none;
    color: var(--text-main);
    background: var(--surface);
    border: 1px solid transparent;
    border-radius: 0.7rem;
    padding: 0.86rem 0.95rem;
    letter-spacing: 0.04em;
    transition: transform 220ms ease, border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.secret-card:hover,
.secret-card:focus-visible {
    outline: none;
    transform: translateX(-2px) scale(1.01);
    border-color: color-mix(in srgb, var(--accent) 54%, transparent);
    background: var(--surface-strong);
    box-shadow: 0 0 1.25rem rgba(229, 152, 155, 0.23);
}

.secret-card__label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.status-badge {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    border-radius: 999px;
    padding: 0.2rem 0.52rem;
    border: 1px solid transparent;
    flex-shrink: 0;
}

.status-badge[data-status="online"] {
    color: #d9ffe6;
    border-color: rgba(140, 246, 184, 0.35);
    background: rgba(72, 166, 108, 0.28);
}

.status-badge[data-status="offline"] {
    color: #ffe0e0;
    border-color: rgba(255, 165, 165, 0.32);
    background: rgba(168, 72, 72, 0.24);
}

.auth-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: grid;
    place-items: center;
    background: rgba(33, 30, 39, 0.52);
    opacity: 0;
    pointer-events: none;
    transition: opacity 260ms ease;
    padding: 1rem;
}

.auth-modal-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
}

.auth-modal {
    width: min(92vw, 24rem);
    background: linear-gradient(180deg, rgba(88, 82, 100, 0.97), rgba(70, 64, 82, 0.98));
    border: 1px solid color-mix(in srgb, var(--text-main) 24%, transparent);
    border-radius: 0.85rem;
    padding: 1rem;
}

.auth-modal__title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 0.45rem;
}

.auth-modal__text {
    font-size: 0.84rem;
    margin-bottom: 0.8rem;
    color: color-mix(in srgb, var(--text-main) 82%, transparent);
}

.auth-modal__label {
    display: block;
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
}

.auth-modal__input {
    width: 100%;
    border: 1px solid color-mix(in srgb, var(--text-main) 26%, transparent);
    background: rgba(255, 205, 178, 0.06);
    color: var(--text-main);
    font-family: inherit;
    border-radius: 0.5rem;
    padding: 0.55rem 0.65rem;
}

.auth-modal__input:focus-visible {
    outline: none;
    border-color: var(--focus-ring);
}

.auth-modal__error {
    min-height: 1rem;
    margin: 0.42rem 0 0.68rem;
    font-size: 0.74rem;
    color: #ffd6d6;
}

.auth-modal__actions {
    display: flex;
    gap: 0.45rem;
}

.auth-modal__button {
    border: 1px solid transparent;
    background: rgba(255, 180, 162, 0.2);
    color: var(--text-main);
    border-radius: 0.48rem;
    padding: 0.42rem 0.7rem;
    font-family: inherit;
    cursor: pointer;
}

.auth-modal__button--ghost {
    background: transparent;
    border-color: color-mix(in srgb, var(--text-main) 30%, transparent);
}

body.menu-open .secret-overlay {
    opacity: 1;
    pointer-events: auto;
}

body.menu-open .secret-menu {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

@media (max-width: 480px) {
    .secret-menu {
        width: 100vw;
        padding: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero,
    .hero__title,
    .secret-menu,
    .secret-overlay,
    .reveal,
    .secret-card,
    .icon-toggle {
        animation: none !important;
        transition: none !important;
        transform: none !important;
    }

    .petals {
        display: none;
    }
}