:root {
    --bg: #0b0b0b;
    --bg-soft: #121212;
    --bg-card: rgba(255, 255, 255, 0.05);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --text: #f5efe6;
    --muted: #b9afa1;
    --line: rgba(255, 255, 255, 0.08);
    --accent: #8b1e24;
    --accent-hover: #a7262d;
    --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    --radius: 18px;
    --container: 1180px;
    --form-width: 440px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    overflow-x: hidden;
    font-family: Arial, sans-serif;
    background:
        radial-gradient(circle at top, rgba(139, 30, 36, 0.14), transparent 35%),
        linear-gradient(180deg, #0b0b0b 0%, #111 100%);
    color: var(--text);
    line-height: 1.65;
}

img,
video {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
}

.container {
    width: min(92%, var(--container));
    margin: 0 auto;
}

.narrow {
    max-width: 860px;
}

.section,
.section-dark {
    position: relative;
    padding: 84px 0;
}

.section {
    background: transparent;
}

.section-dark {
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01)),
        rgba(255,255,255,0.015);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

h1, h2, h3 {
    margin: 0 0 18px;
    line-height: 1.15;
}

h1 {
    font-size: clamp(38px, 7vw, 74px);
    max-width: 920px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

h2 {
    font-size: clamp(28px, 4vw, 42px);
    margin-bottom: 28px;
}

h3 {
    font-size: 22px;
}

p {
    margin: 0 0 18px;
    color: var(--muted);
}

.hero {
    position: relative;
    overflow: hidden;
    min-height: 92vh;
    display: flex;
    align-items: center;
    text-align: center;
    padding: 70px 0;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.58), rgba(0,0,0,0.82)),
        url("/img2/hero.jpg") center center / cover no-repeat;
}

.hero-pattern {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.16;
    background-image:
        radial-gradient(circle at 25% 30%, rgba(255,255,255,0.06) 0 2px, transparent 2px),
        radial-gradient(circle at 75% 60%, rgba(255,255,255,0.05) 0 2px, transparent 2px),
        repeating-linear-gradient(
            135deg,
            transparent 0 26px,
            rgba(255,255,255,0.025) 26px 27px
        );
    background-size: 240px 240px, 300px 300px, auto;
}

.hero::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -140px;
    transform: translateX(-50%);
    width: 880px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(139, 30, 36, 0.22), transparent 70%);
    filter: blur(24px);
    pointer-events: none;
}

.hero-inner {
    position: relative;
    z-index: 1;
}

.logo {
    width: 120px;
    margin: 0 auto 24px;
    filter: drop-shadow(0 8px 24px rgba(0,0,0,0.35));
}

.eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 13px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #d7c3b1;
}

.subtitle {
    max-width: 760px;
    margin: 0 auto 34px;
    font-size: clamp(18px, 2.2vw, 24px);
    color: #d6cabc;
}

.hero-buttons {
    display: flex;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    appearance: none;
    border: none;
    background: var(--accent);
    color: #fff;
    padding: 14px 28px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 12px 28px rgba(139, 30, 36, 0.28);
}

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.06);
}

.grid {
    display: grid;
    gap: 22px;
}

.grid-cards {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.card {
    padding: 28px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    backdrop-filter: blur(4px);
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.card:hover {
    transform: translateY(-4px);
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.14);
}

.card p:last-child {
    margin-bottom: 0;
}

.video-wrap {
    max-width: 980px;
    margin: 0 auto;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    background: #000;
}

.video video {
    width: 100%;
    height: auto;
}

.grid-gallery {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.gallery img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 16px;
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease;
}

.gallery img:hover {
    transform: translateY(-4px) scale(1.01);
}

.projects {
    text-align: center;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 22px;
}

.project-card {
    min-height: 190px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 28px;
    border-radius: var(--radius);
    text-decoration: none;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.02), rgba(139,30,36,0.10)),
        rgba(255,255,255,0.04);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    transition: transform 0.25s ease, background 0.25s ease;
}

.project-card:hover {
    transform: translateY(-4px);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(139,30,36,0.18)),
        rgba(255,255,255,0.05);
}

.project-card.disabled {
    opacity: 0.58;
    cursor: default;
}

.project-card.disabled:hover {
    transform: none;
}

.project-title {
    display: block;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text);
}

.project-text {
    display: block;
    color: var(--muted);
}

.contact-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, var(--form-width));
    gap: 36px;
    align-items: start;
    padding: 34px;
    border-radius: 24px;
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.contact-info p {
    max-width: 560px;
}

.contact-form {
    width: 100%;
    max-width: var(--form-width);
    justify-self: end;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

input,
textarea {
    width: 100%;
    padding: 15px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
    color: #fff;
    font: inherit;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease;
}

input::placeholder,
textarea::placeholder {
    color: #b8aa99;
}

input:focus,
textarea:focus {
    border-color: rgba(139, 30, 36, 0.8);
    background: rgba(255,255,255,0.08);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

.contact-form .btn {
    width: 100%;
    margin-top: 4px;
}

.contacts {
    margin-top: 26px;
}

.contacts p {
    margin-bottom: 10px;
}

.contacts a {
    color: #e6d7c9;
    text-decoration: none;
}

.contacts a:hover {
    text-decoration: underline;
}

.back-link {
    display: inline-flex;
    margin-bottom: 22px;
    color: #e6d7c9;
    text-decoration: none;
    font-weight: 700;
}

.back-link:hover {
    text-decoration: underline;
}

.yokai-hero {
    min-height: 84vh;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.54), rgba(0,0,0,0.86)),
        url("/img/yokai/scene-4.png") center center / cover no-repeat;
}

.yokai-hero .back-link {
    position: absolute;
    top: 26px;
    left: max(24px, calc((100% - var(--container)) / 2));
    z-index: 2;
    margin-bottom: 0;
}

.yokai-page h1 {
    letter-spacing: 0;
}

.yokai-intro {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 390px);
    gap: 38px;
    align-items: start;
}

.yokai-copy p {
    font-size: 18px;
}

.yokai-text-section {
    padding: 22px 0;
    border-top: 1px solid var(--line);
}

.yokai-text-section:first-of-type {
    padding-top: 0;
    border-top: none;
}

.yokai-text-section h3 {
    margin-bottom: 12px;
    color: var(--text);
}

.yokai-text-section p:last-child {
    margin-bottom: 0;
}

.lead-section p:first-child,
.final-thought p {
    color: var(--text);
    font-size: 21px;
}

.yokai-feature-image,
.yokai-image-grid img {
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    box-shadow: var(--shadow);
}

.yokai-feature-image img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
}

.yokai-media {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
    gap: 28px;
    align-items: stretch;
}

.yokai-video {
    overflow: hidden;
    border-radius: 22px;
    border: 1px solid var(--line);
    background: #000;
    box-shadow: var(--shadow);
}

.yokai-video video {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
}

.program-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    min-height: 320px;
    padding: 28px;
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.03), rgba(139,30,36,0.16)),
        rgba(255,255,255,0.05);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    text-decoration: none;
    transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}

.program-card:hover {
    transform: translateY(-4px);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(139,30,36,0.24)),
        rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.14);
}

.program-label {
    margin-bottom: 12px;
    color: #d7c3b1;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.program-title {
    margin-bottom: 12px;
    color: var(--text);
    font-size: 26px;
    font-weight: 700;
    line-height: 1.15;
}

.program-text {
    color: var(--muted);
}

.yokai-image-grid {
    grid-template-columns: repeat(4, 1fr);
}

.yokai-image-grid img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.poster-header {
    display: flex;
    gap: 28px;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 28px;
}

.poster-header p {
    max-width: 620px;
}

.poster-list {
    display: grid;
    gap: 16px;
}

.poster-item {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr) minmax(190px, 290px) auto;
    gap: 18px;
    align-items: center;
    padding: 22px 24px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.poster-item-muted {
    opacity: 0.76;
}

.poster-date,
.poster-title,
.poster-place {
    display: block;
}

.poster-date {
    color: #e6d7c9;
    font-weight: 700;
}

.poster-title {
    color: var(--text);
    font-size: 20px;
    font-weight: 700;
}

.poster-place {
    color: var(--muted);
}

.poster-button,
.poster-status {
    justify-self: end;
    white-space: nowrap;
}

.poster-button {
    display: inline-flex;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    transition: background 0.25s ease, transform 0.25s ease;
}

.poster-button:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.poster-status {
    color: #e6d7c9;
    font-weight: 700;
}

.material-page {
    background:
        radial-gradient(circle at top left, rgba(139, 30, 36, 0.18), transparent 34%),
        linear-gradient(180deg, #0b0b0b 0%, #111 100%);
}

.material-hero {
    position: relative;
    padding: 88px 0 42px;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.46), rgba(0,0,0,0.86)),
        url("/img/yokai/scene-4.png") center center / cover no-repeat;
    border-bottom: 1px solid var(--line);
}

.material-hero-inner {
    position: relative;
    z-index: 1;
}

.material-hero .back-link {
    position: absolute;
    top: 22px;
    left: max(18px, calc((100% - var(--container)) / 2));
    z-index: 2;
    margin-bottom: 0;
}

.material-hero h1 {
    max-width: 760px;
    margin-left: 0;
    margin-right: 0;
    text-align: left;
    font-size: clamp(30px, 5vw, 48px);
    line-height: 1.08;
}

.material-hero .subtitle {
    max-width: 720px;
    margin-left: 0;
    margin-right: 0;
    color: #e5d9cb;
}

.material-nav {
    position: sticky;
    top: 0;
    z-index: 20;
    background: rgba(11, 11, 11, 0.9);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
}

.material-nav-inner {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-top: 12px;
    padding-bottom: 12px;
    scrollbar-width: none;
}

.material-nav-inner::-webkit-scrollbar {
    display: none;
}

.material-nav a {
    flex: 0 0 auto;
    padding: 9px 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--line);
    color: #e6d7c9;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.material-content {
    padding: 34px 0 72px;
}

.material-stack {
    display: grid;
    gap: 22px;
}

.material-section {
    display: grid;
    grid-template-columns: minmax(0, 330px) minmax(0, 1fr);
    gap: 26px;
    align-items: start;
    padding: 24px;
    border-radius: 22px;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    scroll-margin-top: 86px;
}

.material-section-image {
    position: sticky;
    top: 86px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
}

.material-section-image img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.material-section-body h2 {
    margin-bottom: 18px;
}

.material-section-body h3 {
    margin-top: 28px;
    margin-bottom: 10px;
    color: var(--text);
    font-size: 21px;
}

.material-section-body h3:first-child {
    margin-top: 0;
}

.material-subitems {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.material-subitem {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 14px;
    border-radius: 16px;
    background: rgba(255,255,255,0.035);
    border: 1px solid var(--line);
}

.material-subitem img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
}

.material-subitem h3 {
    margin-top: 0;
}

.material-section-body p {
    font-size: 18px;
}

.material-section-body strong {
    color: var(--text);
}

.top-link {
    display: inline-flex;
    margin-top: 10px;
    color: #e6d7c9;
    font-weight: 700;
    text-decoration: none;
}

.top-link:hover {
    text-decoration: underline;
}

.read-more-link {
    display: inline;
    margin-top: 8px;
    color: #e6d7c9;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.read-more-link:hover {
    color: #fff;
}

.material-section-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 24px;
    padding-top: 18px;
    border-top: 1px solid rgba(230, 215, 201, 0.16);
}

.material-section-footer .read-more-link,
.material-section-footer .top-link {
    margin-top: 0;
}

.material-section-footer .top-link {
    color: rgba(230, 215, 201, 0.72);
    font-size: 0.95rem;
}

.zoomable-image {
    cursor: zoom-in;
    touch-action: manipulation;
}

body.lightbox-open {
    overflow: hidden !important;
}

.image-lightbox {
    position: fixed !important;
    inset: 0 !important;
    z-index: 10000 !important;
    display: none !important;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100dvh;
    padding: 14px;
    box-sizing: border-box;
    pointer-events: none;
}

.image-lightbox.is-open {
    display: flex !important;
    pointer-events: auto;
}

.image-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 7, 8, 0.86);
    backdrop-filter: blur(4px);
}

.image-lightbox-dialog {
    position: relative !important;
    z-index: 1;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    width: min(100%, 980px);
    max-height: calc(100dvh - 28px);
    margin: 0;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    background: rgba(17, 18, 18, 0.96);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.55);
}

.image-lightbox-frame {
    display: flex;
    min-height: 0;
    align-items: center;
    justify-content: center;
    padding: 48px 10px 10px;
}

.image-lightbox img {
    display: block;
    width: auto !important;
    max-width: 100%;
    height: auto !important;
    max-height: calc(100dvh - 132px);
    aspect-ratio: auto !important;
    object-fit: contain;
    border-radius: 6px;
}

.image-lightbox-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255,255,255,0.22);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.48);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.image-lightbox-caption {
    min-height: 38px;
    padding: 0 16px 14px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.92rem;
    text-align: center;
}

@media (max-width: 900px) {
    .hero {
        min-height: auto;
        padding: 90px 0 70px;
        background-position: center center;
    }

    .contact-box {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .contact-form {
        max-width: 100%;
        justify-self: stretch;
    }

    .yokai-intro,
    .yokai-media,
    .poster-item {
        grid-template-columns: 1fr;
    }

    .yokai-video video {
        height: auto;
        min-height: 0;
    }

    .program-card {
        min-height: auto;
    }

    .poster-button,
    .poster-status {
        justify-self: start;
    }

    .yokai-image-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .poster-header {
        flex-direction: column;
    }

    .material-section {
        grid-template-columns: 1fr;
    }

    .material-section-image {
        position: static;
    }
}

@media (max-width: 640px) {
    .section,
    .section-dark {
        padding: 64px 0;
    }

    .logo {
        width: 96px;
    }

    .card,
    .project-card,
    .contact-box {
        padding: 22px;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-buttons .btn {
        width: 100%;
    }

    h1 {
        font-size: clamp(34px, 9vw, 52px);
    }

    .subtitle {
        font-size: 18px;
    }

    .yokai-image-grid {
        grid-template-columns: 1fr;
    }

    .material-hero {
        padding: 76px 0 34px;
    }

    .material-hero h1 {
        font-size: 28px;
    }

    .material-nav-inner {
        width: 100%;
        padding-left: 4%;
        padding-right: 4%;
    }

    .material-content {
        padding-top: 22px;
    }

    .material-section {
        width: min(100%, 620px);
        margin: 0 auto;
        padding: 18px;
        border-radius: 18px;
        scroll-margin-top: 76px;
    }

    .material-section-body p {
        font-size: 16px;
    }

    .material-section-body h2 {
        font-size: 30px;
    }

    .material-section-body h3 {
        font-size: 19px;
    }

    .material-section-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }

    .material-subitem {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 12px;
    }

    .material-subitem img {
        aspect-ratio: 4 / 3;
    }
}
