/* ==========================================================================
   大創社 — 静かなる灯台 — 完全統合版 CSS
   - 元のスタイルをベースに、視認性・コントラスト・夜間表現を強化
   - 変更箇所は "/* CHANGE */
/* コメントで示しています
==========================================================================*/

/* ===============================
   0. Root variables (カラー調整はここを編集)
   =============================== */
:root {
    --lighthouse-primary: #667eea;
    --lighthouse-primary-dark: #4f46e5;
    --lighthouse-secondary: #f093fb;
    --lighthouse-accent: #f59e0b;
    --lighthouse-gold: #d97706;

    --bg-light: #f8fafc;
    /* 全体のライト背景 */
    --text-light: #1f2937;
    /* body テキスト(昼) = slate-800 */
    --muted-light: #64748b;
    /* 補助テキスト(昼) */

    --bg-dark: #030712;
    /* 全体のダーク背景 */
    --text-dark: #d1d5db;
    /* body テキスト(夜) */
    --muted-dark: #9ca3af;
    /* 補助テキスト(夜) */

    /* ロゴ横の大創社用（CHANGE: 昼は濃いめ、夜は明るめ） */
    --brand-text-light: #0b1220;
    /* slate-900 相当 */
    --brand-text-dark: #f8fafc;
    /* near white */

    /* Explore セクション背景（CHANGE: 昼は淡グレー、夜は深め） */
    --explore-bg-light: #f1f5f9;
    /* slate-50 / 少しやわらかめ */
    --explore-bg-dark: #020406;
    /* 非常に濃い夜背景（slate-950ライク） */

    /* Card background overrides */
    --card-bg-light: #ffffff;
    --card-bg-dark: #0f1724;
    /* 少し黒寄りのスレート */

    --focus-color: rgba(99, 102, 241, 0.22);
    --cta-radius: 10px;
}

/* ===============================
   1. 基本レイアウト / タイポグラフィ
   =============================== */
html,
body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
    background: var(--bg-light);
    color: var(--text-light);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.75;
    -webkit-text-size-adjust: 100%;
}

/* Dark mode base */
html.dark body {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* Article readable width */
.article-body {
    font-size: 1.125rem;
    line-height: 1.8;
    max-width: 42em;
    margin-left: auto;
    margin-right: auto;
}

/* Headings */
h1,
h2,
h3,
h4 {
    font-family: "Noto Serif JP", serif;
    margin: 0 0 .5rem 0;
}

h1,
h2 {
    letter-spacing: -0.01em;
}

/* ===============================
   2. ヘッダー / ナビゲーション
   =============================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 60;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(15, 23, 42, 0.04);
}

/* dark header */
html.dark .site-header {
    background: rgba(6, 8, 15, 0.78);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Brand area (logo + text) */
.site-header .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Logo circle glow */
.lighthouse-glow {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.0));
    box-shadow: 0 4px 16px rgba(2, 6, 23, 0.06);
    transition: box-shadow .3s ease, transform .3s ease;
}

/* Brand text — CHANGE: 昼はより濃く、夜は明るく */
.site-header .brand .brand-text {
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--brand-text-light);
    /* CHANGE */
}

html.dark .site-header .brand .brand-text {
    color: var(--brand-text-dark);
    /* CHANGE */
}

/* Navigation links */
nav[aria-label="メインナビ"] .nav-link {
    position: relative;
    padding-bottom: 4px;
    text-decoration: none;
    font-weight: 500;
    color: var(--text-light);
    transition: color .22s ease;
}

/* CHANGE: 強めの昼文字色 + hover */
nav[aria-label="メインナビ"] .nav-link {
    color: #111827;
    /* slate-900 stronger — CHANGE */
}

nav[aria-label="メインナビ"] .nav-link:hover {
    color: var(--lighthouse-primary);
}

/* dark mode nav */
html.dark nav[aria-label="メインナビ"] .nav-link {
    color: #e6e9ee;
    /* light slate — CHANGE */
}

html.dark nav[aria-label="メインナビ"] .nav-link:hover {
    color: var(--lighthouse-primary);
}

/* nav underline micro effect */
.nav-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    height: 2px;
    width: 0%;
    background: var(--lighthouse-gold);
    transition: width .28s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* mobile menu container */
#mobile-menu {
    transition: max-height .28s ease;
}

/* ===============================
   3. HERO
   =============================== */
#hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    overflow: hidden;
}

/* slide base (hero-slide used as picture wrapper) */
.hero-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1.4s cubic-bezier(.22, .9, .34, 1);
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* active visible slide */
.hero-slide.active {
    opacity: 1;
}

/* subtle overlay to ensure text legibility */
.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(5, 10, 20, 0.35), rgba(5, 10, 20, 0.55));
    pointer-events: none;
}

/* breathing hero content */
@keyframes quietBreathe {

    0%,
    100% {
        opacity: 0.96;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

.hero-content {
    animation: quietBreathe 6s ease-in-out infinite;
}

/* lighthouse beam (dark) */
html.dark .lighthouse-beam {
    position: absolute;
    inset: 0;
    pointer-events: none;
    mix-blend-mode: screen;
    background: radial-gradient(circle at center, rgba(255, 255, 210, 0.06) 0%, rgba(255, 255, 210, 0.02) 20%, transparent 40%);
    animation: lightSweep 12s linear infinite;
}

@keyframes lightSweep {
    0% {
        opacity: .12;
        transform: rotate(0deg);
    }

    50% {
        opacity: .45;
    }

    100% {
        opacity: .12;
        transform: rotate(360deg);
    }
}

/* ===============================
   4. EXPLORE セクション（CHANGE: 背景・見出し・カード調整）
   =============================== */
/* override utility classes with explicit styles to ensure consistency */
#explore {
    padding-top: 5rem;
    padding-bottom: 5rem;
    background: var(--explore-bg-light);
    /* CHANGE: 昼用 */
    transition: background .3s ease;
}

html.dark #explore {
    background: var(--explore-bg-dark);
    /* CHANGE: 夜用 */
}

/* heading color stronger */
#explore h2 {
    font-size: 1.875rem;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    color: #0b1220;
    /* slate-900 strong — CHANGE */
}

html.dark #explore h2 {
    color: #ffffff;
    /* CHANGE */
}

/* paragraph muted */
#explore p {
    color: var(--muted-light);
    margin-bottom: 3rem;
    max-width: 56ch;
    margin-left: auto;
    margin-right: auto;
}

html.dark #explore p {
    color: var(--muted-dark);
}

/* grid cards */
#explore .grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media(min-width:768px) {
    #explore .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* card wrapper */
.card-hover {
    display: block;
    padding: 2rem;
    border-radius: 1rem;
    background: var(--card-bg-light);
    border: 1px solid rgba(15, 23, 42, 0.04);
    color: inherit;
    transition: transform .28s cubic-bezier(.22, .9, .34, 1), box-shadow .28s cubic-bezier(.22, .9, .34, 1);
}

/* hover/active */
.card-hover:hover,
.card-hover:focus-within {
    transform: translateY(-8px);
    box-shadow: 0 22px 50px rgba(2, 6, 23, 0.12);
}

/* dark mode card */
html.dark .card-hover {
    background: var(--card-bg-dark);
    border: 1px solid rgba(255, 255, 255, 0.04);
    color: var(--text-dark);
}

/* CHANGE: 夜モードでは影を濃くして「浮き感」を出す */
html.dark .card-hover:hover,
html.dark .card-hover:focus-within {
    transform: translateY(-8px);
    box-shadow: 0 22px 60px rgba(0, 0, 0, 0.6);
    /* stronger shadow for night — CHANGE */
}

/* titles in cards */
.card-hover h3 {
    margin: 0 0 .6rem 0;
    font-size: 1.25rem;
    color: inherit;
}

.card-hover p {
    margin: 0;
    color: var(--muted-light);
}

html.dark .card-hover p {
    color: var(--muted-dark);
}

/* ===============================
   5. CTA Buttons (強化)
   =============================== */
.cta-primary {
    display: inline-block;
    background: var(--lighthouse-accent);
    color: #031025;
    padding: .6rem 1.2rem;
    border-radius: var(--cta-radius);
    font-weight: 700;
    box-shadow: 0 10px 28px rgba(2, 6, 23, 0.08);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.cta-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 36px rgba(2, 6, 23, 0.12);
    background: #f59e0b;
}

.cta-secondary {
    display: inline-block;
    padding: .55rem 1rem;
    border-radius: var(--cta-radius);
    font-weight: 700;
    border: 2px solid var(--lighthouse-primary);
    color: var(--lighthouse-primary);
    background: transparent;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.cta-secondary:hover {
    background: var(--lighthouse-primary);
    color: #fff;
    transform: translateY(-2px);
}

/* night tweaks for CTA secondary (CHANGE) */
html.dark .cta-secondary {
    border-color: rgba(229, 231, 235, 0.95);
    color: rgba(229, 231, 235, 0.95);
}

html.dark .cta-secondary:hover {
    background: rgba(229, 231, 235, 0.95);
    color: #0b1220;
}

/* ===============================
   6. Footer
   =============================== */
footer {
    background: #0f172a;
    /* dark slate */
    color: var(--muted-light);
    /* CHANGE: adjust day fallback in case of no dark class */
    padding-top: 3rem;
    padding-bottom: 3rem;
}

footer p,
footer a {
    color: inherit;
}

html.dark footer {
    color: var(--muted-dark);
}

/* footer headings */
footer h3 {
    color: #ffffff;
    margin-bottom: .75rem;
}

/* small text */
footer .text-sm {
    color: rgba(255, 255, 255, 0.68);
}

/* ===============================
   7. Cards / Utilities / accessibility
   =============================== */
.card {
    background: var(--card-bg-light);
    border-radius: 0.75rem;
    padding: 1.5rem;
}

html.dark .card {
    background: var(--card-bg-dark);
    color: var(--text-dark);
}

/* focus outlines */
.focus-outline:focus {
    outline: 3px solid var(--focus-color);
    outline-offset: 3px;
    border-radius: 8px;
}

/* skip-link improved */
.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    position: fixed;
    z-index: 1000;
    padding: .5rem 1rem;
    background: #fff;
    color: #0f1724;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(2, 6, 23, 0.12);
}

/* ===============================
   8. Animations
   =============================== */
@keyframes quiet-breathe {

    0%,
    100% {
        opacity: .96;
        transform: translateY(0);
    }

    50% {
        opacity: 1;
        transform: translateY(-3px);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .hero-slide,
    .hero-content,
    .lighthouse-beam,
    .card-hover,
    .nav-link::after {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        box-shadow: none !important;
    }
}

/* ===============================
   9. Small screens / responsive tweaks
   =============================== */
@media (max-width:767px) {
    .site-header {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .hero-content {
        padding-left: 1rem;
        padding-right: 1rem;
    }

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

/* ===============================
   10. Helper / Debug (optional)
   =============================== */
/* .debug-outline *{ outline:1px dashed rgba(255,0,0,0.08); } */

/* PWA 更新トースト（軽量） */
#sw-update-toast {
    position: fixed;
    right: 1rem;
    bottom: 1.25rem;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: sw-toast-in .28s ease;
}

.sw-toast {
    background: linear-gradient(180deg, #0b1220, #0f1724);
    color: #fff;
    padding: .85rem .9rem;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(2, 6, 23, 0.36);
    display: flex;
    gap: .6rem;
    align-items: center;
    font-size: .95rem;
}

.sw-toast__controls {
    display: flex;
    gap: .5rem;
}

.sw-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: .45rem .7rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
}

.sw-btn:hover {
    transform: translateY(-1px);
}

.sw-btn-primary {
    background: #67d;
    border-color: #67d;
    color: #061124;
}

@keyframes sw-toast-in {
    from {
        transform: translateY(10px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

.sw-toast--hiding {
    opacity: 0;
    transform: translateY(10px);
    transition: .35s;
}