@font-face {
    font-family: 'Artemis Inter';
    src: url('fonts/Artemis_Inter.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Minecraft';
    src: url('Minecraft.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Unifont-JP';
    src: url('fonts/jp.woff2') format('woff2'),
         url('fonts/jp.otf') format('opentype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Smart Font UI';
    src: url('fonts/03スマートフォントUI.woff2') format('woff2'),
         url('fonts/03スマートフォントUI.otf') format('opentype');
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Zen Maru Gothic (local, /fonts/zen). Regular is the base weight;
   the other faces are only used when a rule asks for them. */
@font-face {
    font-family: 'Zen Maru Gothic';
    src: url('fonts/zen/ZenMaruGothic-Light.woff2') format('woff2'),
         url('fonts/zen/ZenMaruGothic-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Zen Maru Gothic';
    src: url('fonts/zen/ZenMaruGothic-Regular.woff2') format('woff2'),
         url('fonts/zen/ZenMaruGothic-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Zen Maru Gothic';
    src: url('fonts/zen/ZenMaruGothic-Medium.woff2') format('woff2'),
         url('fonts/zen/ZenMaruGothic-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Zen Maru Gothic';
    src: url('fonts/zen/ZenMaruGothic-Bold.woff2') format('woff2'),
         url('fonts/zen/ZenMaruGothic-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Zen Maru Gothic';
    src: url('fonts/zen/ZenMaruGothic-Black.woff2') format('woff2'),
         url('fonts/zen/ZenMaruGothic-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --bg-body: #0b1120;
    --bg-body-2: #111827;
    --bg-card: rgba(30, 41, 59, 0.55);
    --bg-card-hover: rgba(51, 65, 85, 0.72);
    --bg-sidebar: rgba(11, 17, 32, 0.82);
    --border: rgba(148, 163, 184, 0.14);
    --border-strong: rgba(148, 163, 184, 0.24);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --accent: #38bdf8;
    --accent-hover: #7dd3fc;
    --accent-warm: #f97316;
    --accent-warm-hover: #fb923c;
    --sidebar-width: 240px;
    --radius: 18px;
    --radius-sm: 12px;
    --shadow-sm: 0 4px 12px rgba(2, 6, 23, 0.28);
    --shadow: 0 12px 32px rgba(2, 6, 23, 0.38);

    /* Selectable Japanese body font. site.js sets data-font on <html>. */
    --font-jp: 'Unifont-JP';
    --font-zen: 'Zen Maru Gothic';
    --font-smart: 'Smart Font UI';
    --font-main: var(--font-smart);
}

/* Font preference is chosen in the settings modal (see site.js).
   Default (no stored choice, or JS disabled) is Smart Font UI. */
html[data-font="jp"] {
    --font-main: var(--font-jp);
}

html[data-font="zen"] {
    --font-main: var(--font-zen);
}

html[data-font="smart"] {
    --font-main: var(--font-smart);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Visually hidden but accessible to screen readers and search engines */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0d1117;
    background-image: url('/images/tech-hero-bg.svg');
    background-size: cover;
    background-position: center top;
    background-attachment: fixed;
    background-repeat: no-repeat;
    color: var(--text-primary);
    font-family: var(--font-main), sans-serif;
    font-size: 16px;
    line-height: 1.75;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-wrap: anywhere;
}

a {
    color: inherit;
    text-decoration: none;
}

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

button {
    font: inherit;
    color: inherit;
}

/* ── Layout ───────────────────────────────────────── */

.site {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    min-height: 100vh;
    min-height: 100dvh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 32px 24px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 100;
}

.sidebar-brand {
    margin-bottom: 40px;
}

.sidebar-logo {
    font-family: 'Artemis Inter', var(--font-main), sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1.35;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.sidebar-logo:hover {
    color: var(--accent);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    margin-right: -24px;
    padding-right: 24px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item[aria-current="page"] {
    background-color: rgba(56, 189, 248, 0.12);
    color: var(--accent);
    font-weight: 700;
}

.nav-item::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

.nav-item[aria-current="page"]::before {
    opacity: 1;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 24px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    border-top: 1px solid var(--border);
}

.sidebar-footer .hosting {
    margin: 0 0 4px;
    text-align: center;
}

/* Sidebar sub navigation */
.nav-group {
    display: flex;
    flex-direction: column;
}

/* Main nav items with submenus */
.nav-group--has-submenu > .nav-item {
    position: relative;
}

.nav-group--has-submenu > .nav-item::after {
    content: '›';
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.9rem;
    transition: transform 0.45s ease, color 0.45s ease;
}

.nav-group--has-submenu:hover > .nav-item::after,
.nav-group--has-submenu:focus-within > .nav-item::after {
    transform: rotate(90deg);
    color: var(--text-primary);
}

.nav-sub {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    padding-left: 14px;
    margin: 2px 0 0;
    border-left: 1px solid var(--border);
    transform: translateY(-8px);
    transition: max-height 0.65s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.45s ease,
                visibility 0.45s ease,
                transform 0.45s ease;
    transition-delay: 0.15s;
    pointer-events: none;
}

.nav-group--has-submenu:hover > .nav-sub,
.nav-group--has-submenu:focus-within > .nav-sub {
    max-height: 1000px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
    pointer-events: auto;
}

/* Nested sub-sections (Find Me / My Works) */
.nav-sub-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.nav-sub-section--has-submenu > .nav-sub-heading {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.archive-node--has-submenu > .archive-label {
    display: flex;
    align-items: center;
    cursor: default;
}

.nav-sub-section--has-submenu > .nav-sub-heading::after,
.archive-node--has-submenu > .archive-label::after {
    content: '›';
    margin-left: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    transition: transform 0.4s ease, color 0.4s ease;
}

.nav-sub-section--has-submenu.is-open > .nav-sub-heading::after,
.nav-sub-section--has-submenu:focus-within > .nav-sub-heading::after,
.archive-node--has-submenu.is-open > .archive-label::after,
.archive-node--has-submenu:focus-within > .archive-label::after {
    transform: rotate(90deg);
    color: var(--text-primary);
}

.nav-sub-heading {
    display: block;
    padding: 6px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav-sub-panel,
.archive-panel {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    padding: 4px 0 0 12px;
    margin: 0;
    border-left: 1px solid var(--border);
    transform: translateY(-6px);
    transition: max-height 0.55s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.4s ease,
                visibility 0.4s ease,
                transform 0.4s ease;
    transition-delay: 0.15s;
    pointer-events: none;
}

.nav-sub-section--has-submenu.is-open > .nav-sub-panel,
.nav-sub-section--has-submenu:focus-within > .nav-sub-panel,
.archive-node--has-submenu.is-open > .archive-panel,
.archive-node--has-submenu:focus-within > .archive-panel {
    max-height: 800px;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition-delay: 0s;
    pointer-events: auto;
}

.nav-sub-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 10px;
    color: var(--text-secondary);
    font-size: 0.88rem;
    font-weight: 500;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.nav-sub-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-sub-item[target="_blank"]::after {
    content: '↗';
    margin-left: auto;
    color: var(--text-muted);
    font-size: 0.75rem;
}

.nav-sub-empty {
    padding: 8px 12px;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Memo archive tree */
.archive-tree,
.archive-tree ul,
.archive-panel {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.archive-tree ul,
.archive-panel {
    padding-left: 14px;
    margin: 2px 0 4px;
}

.archive-year > .archive-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
}

.archive-month > .archive-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.archive-label {
    display: block;
    padding: 4px 10px;
    letter-spacing: 0.04em;
}

.archive-post {
    display: block;
    padding: 6px 10px;
    border-radius: 8px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.archive-post:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.content {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    padding: 56px max(40px, env(safe-area-inset-right)) 120px max(40px, env(safe-area-inset-left));
    animation: page-enter 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.content--wide {
    max-width: 1280px;
}

.content-footer {
    margin-top: 100px;
    padding-top: 28px;
    border-top: 1px solid var(--border);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ── Mobile menu ──────────────────────────────────── */

.menu-toggle {
    display: none;
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    left: max(16px, env(safe-area-inset-left));
    z-index: 120;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.menu-toggle svg {
    width: 22px;
    height: 22px;
}

.site-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, 0.65);
    z-index: 90;
    opacity: 0;
    transition: opacity 0.25s ease;
}

body.sidebar-open .site-backdrop {
    display: block;
    opacity: 1;
}

body.sidebar-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .site {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        width: min(280px, 80vw);
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
        border-right: none;
        box-shadow: var(--shadow);
        padding: max(32px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    }

    body.sidebar-open .sidebar {
        transform: translateX(0);
    }

    .menu-toggle {
        display: flex;
    }

    body.has-kao-banner .kao-banner {
        position: sticky;
        top: 0;
        z-index: 130;
    }

    body.has-kao-banner .menu-toggle {
        top: calc(max(12px, env(safe-area-inset-top)) + 48px);
    }

    body.sidebar-open .menu-toggle {
        display: none;
    }

    .content {
        padding: 92px max(20px, env(safe-area-inset-right)) 80px max(20px, env(safe-area-inset-left));
    }

    .section {
        margin-bottom: 48px;
    }

    /* Submenus stay closed until toggled via tap */
    .nav-group--has-submenu:hover > .nav-sub,
    .nav-group--has-submenu:focus-within > .nav-sub {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-8px);
        pointer-events: none;
    }

    .nav-group--has-submenu.is-open > .nav-sub {
        max-height: 1000px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .nav-sub-section--has-submenu:hover > .nav-sub-panel,
    .nav-sub-section--has-submenu:focus-within > .nav-sub-panel {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        pointer-events: none;
    }

    .nav-sub-section--has-submenu.is-open > .nav-sub-panel {
        max-height: 800px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }

    .archive-node--has-submenu:hover > .archive-panel,
    .archive-node--has-submenu:focus-within > .archive-panel {
        max-height: 0;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-6px);
        pointer-events: none;
    }

    .archive-node--has-submenu.is-open > .archive-panel {
        max-height: 800px;
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
        pointer-events: auto;
    }
}

/* ── Page transitions ─────────────────────────────── */

@keyframes page-enter {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

body.is-leaving .content {
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .content {
        animation: none;
    }

    body.is-leaving .content {
        transition: none;
        opacity: 1;
        transform: none;
    }

    .sidebar {
        transition: none;
    }
}

/* ── Typography ───────────────────────────────────── */

.section {
    margin-bottom: 72px;
}

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

.section-title {
    font-family: 'Artemis Inter', var(--font-main), sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 24px;
    text-wrap: balance;
}

.section-title-accent {
    color: var(--accent);
}

.section-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.section-more:hover {
    color: var(--accent);
}

.lead {
    font-size: clamp(1rem, 2.4vw, 1.35rem);
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ── Cards ────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
                background-color 0.22s ease,
                box-shadow 0.22s ease;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.card:hover {
    transform: translateY(-3px);
    background: var(--bg-card-hover);
    box-shadow: var(--shadow);
}

.card-link {
    display: block;
    outline: none;
    padding: 12px 0;
}

.card-link:hover .memo-card-title,
.card-link:focus-visible .memo-card-title {
    color: var(--accent);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

@media (max-width: 600px) {
    .card-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1rem;
        margin-bottom: 18px;
    }

    .icon-card,
    .app-card-link {
        gap: 14px;
        padding: 14px 0;
    }

    .icon-card-icon {
        width: 44px;
        height: 44px;
    }

    .app-card-desc {
        font-size: 0.85rem;
    }
}

/* ── Profile ──────────────────────────────────────── */

.profile-card {
    display: grid;
    grid-template-columns: 96px 1fr;
    align-items: start;
    gap: 24px;
}

.profile-icon {
    position: relative;
    display: inline-flex;
    justify-content: center;
    cursor: pointer;
}

.profile-icon img {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-strong);
    transition: transform 0.4s ease, border-color 0.2s ease;
}

.profile-icon:hover img {
    transform: rotate(8deg) scale(1.04);
    border-color: var(--accent);
}

.photo-note {
    position: absolute;
    left: 50%;
    top: -12px;
    transform: translate(-50%, -100%);
    background: var(--bg-card-hover);
    color: var(--text-primary);
    font-size: 0.76rem;
    padding: 8px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-strong);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
}

.photo-note.show {
    opacity: 1;
    transform: translate(-50%, -100%) translateY(-4px);
}

.photo-note::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -6px;
    width: 10px;
    height: 10px;
    background: var(--bg-card-hover);
    border-right: 1px solid var(--border-strong);
    border-bottom: 1px solid var(--border-strong);
    transform: translateX(-50%) rotate(45deg);
}

.bio-meta {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.bio p + p {
    margin-top: 10px;
}

@media (max-width: 520px) {
    .profile-card {
        grid-template-columns: 1fr;
        justify-items: center;
        text-align: center;
    }

    .profile-icon {
        justify-content: center;
    }
}

/* ── Contact / App cards ──────────────────────────── */

.icon-card {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 16px 0;
    transition: color 0.2s ease, transform 0.2s ease;
}

.icon-card:hover {
    color: var(--accent);
    transform: translateX(4px);
}

button.icon-card {
    background: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

button.icon-card:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
    border-radius: 6px;
}

.icon-card:hover .icon-card-icon {
    background: rgba(255, 255, 255, 0.1);
}

.icon-card-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    background: rgba(15, 23, 42, 0.7);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    flex-shrink: 0;
}

.icon-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.icon-card-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.icon-card-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.icon-card-value {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.app-card-link {
    display: flex;
    align-items: center;
    gap: 18px;
    outline: none;
    padding: 16px 0;
}

.app-card-link .icon-card-value {
    margin-bottom: 4px;
}

.app-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.app-card-arrow {
    margin-left: auto;
    color: var(--text-muted);
    transition: transform 0.22s ease, color 0.22s ease;
}

.app-card-link:hover .app-card-arrow {
    transform: translateX(4px);
    color: var(--accent);
}

/* ── Home page ────────────────────────────────────── */

.home-hero {
    margin-bottom: 72px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--border);
}

.home-hero-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.home-hero-title {
    font-family: 'Artemis Inter', var(--font-main), sans-serif;
    font-size: clamp(2.6rem, 7vw, 4.2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    color: var(--text-primary);
    line-height: 1.05;
    margin-bottom: 16px;
}

.home-hero-desc {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.7;
    max-width: 480px;
}

.home-section {
    margin-bottom: 64px;
}

.home-section-title {
    font-family: 'Artemis Inter', var(--font-main), sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.home-profile {
    display: flex;
    align-items: center;
    gap: 28px;
}

.home-profile .profile-icon img {
    width: 96px;
    height: 96px;
}

.home-profile-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.home-profile-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.home-profile-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.06em;
}

.home-profile-text {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-top: 6px;
}

.home-link-list {
    list-style: none;
    display: grid;
    gap: 0;
    border-top: 1px solid var(--border);
}

.home-link-list li {
    border-bottom: 1px solid var(--border);
}

.home-link-list a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 0;
    color: inherit;
    transition: padding 0.2s ease, color 0.2s ease;
}

.home-link-list a:hover {
    color: var(--accent);
    padding-left: 6px;
}

.home-link-name {
    font-weight: 500;
    color: var(--text-primary);
}

.home-link-list a:hover .home-link-name {
    color: var(--accent);
}

.home-link-handle {
    font-size: 0.88rem;
    color: var(--text-muted);
}

.home-work {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    color: inherit;
    outline: none;
    transition: padding 0.2s ease, color 0.2s ease;
}

.home-work:hover {
    color: var(--accent);
    padding-left: 6px;
}

.home-work-thumb {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 16px;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.7);
}

.home-work-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-work-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.home-work-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.home-work:hover .home-work-title {
    color: var(--accent);
}

.home-work-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

@media (max-width: 520px) {
    .home-hero {
        margin-bottom: 56px;
        padding-bottom: 36px;
    }

    .home-profile {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .home-link-list a {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .home-work {
        flex-wrap: wrap;
    }
}

/* ── Link lists ───────────────────────────────────── */

.link-list {
    list-style: none;
    display: grid;
    gap: 12px;
}

.link-list li {
    border-bottom: 1px solid var(--border);
}

.link-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 14px 0;
    color: var(--text-primary);
    font-weight: 500;
    transition: color 0.2s ease, padding 0.2s ease;
}

.link-list a:hover {
    color: var(--accent);
    padding-left: 8px;
}

.link-list a::after {
    content: '↗';
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.link-list a:hover::after {
    color: var(--accent);
}

/* ── Alliance banners ─────────────────────────────── */

.banner-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
}

.banner-item {
    display: grid;
    place-items: center;
    padding: 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.banner-item:hover {
    transform: translateY(-3px);
    background: var(--bg-card-hover);
}

.banner-item img {
    width: 200px;
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Colophon ─────────────────────────────────────── */

.colophon-intro {
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.colophon-intro:last-child {
    margin-bottom: 0;
}

.meta-list {
    display: grid;
    grid-template-columns: minmax(110px, 150px) 1fr;
    gap: 12px 18px;
}

.meta-list dt {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.meta-list dd {
    color: var(--text-primary);
}

.note-list {
    list-style: disc;
    padding-left: 1.2rem;
    display: grid;
    gap: 10px;
    color: var(--text-secondary);
}

@media (max-width: 520px) {
    .meta-list {
        grid-template-columns: 1fr;
        gap: 16px 0;
    }
}

.text-block {
    color: var(--text-secondary);
    line-height: 1.9;
}

.text-block p + p {
    margin-top: 16px;
}

.text-block a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.text-block a:hover {
    color: var(--accent-hover);
}

/* ── Buttons ──────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    transition: transform 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

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

.btn-primary {
    background: var(--text-primary);
    color: var(--bg-body);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background: #ffffff;
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border-strong);
}

.btn-warm {
    background: var(--accent-warm);
    color: #fff;
}

.btn-warm:hover {
    background: var(--accent-warm-hover);
}

/* ── App page (works/yamaokaya) ───────────────────── */

.app-hero {
    text-align: center;
    padding: 24px 0 56px;
}

.app-logo-lg {
    width: 112px;
    height: 112px;
    border-radius: 26px;
    margin: 0 auto 24px;
    box-shadow: 0 20px 50px rgba(249, 115, 22, 0.22);
}

.app-title {
    font-size: clamp(2rem, 6vw, 3.2rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 16px;
}

.app-tagline {
    font-size: clamp(1rem, 2.2vw, 1.2rem);
    color: var(--text-secondary);
    max-width: 520px;
    margin: 0 auto 28px;
}

.app-overview-copy {
    max-width: 720px;
    margin: 0 auto;
    color: var(--text-secondary);
    line-height: 1.8;
    text-align: center;
}

.app-overview-copy .lead {
    margin-bottom: 12px;
}

.app-platform-note {
    margin-top: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.app-overview-note {
    margin-top: 16px;
    color: var(--text-secondary);
    font-size: 0.92rem;
    line-height: 1.7;
}

.app-feature-list .faq-item dt {
    font-size: 1rem;
}

.app-actions {
    display: flex;
    justify-content: center;
    gap: 14px;
    flex-wrap: wrap;
}

.feature-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 48px;
    padding: 64px 0;
    border-top: 1px solid var(--border);
}

.feature-block:last-child {
    border-bottom: 1px solid var(--border);
}

.feature-block.reversed .feature-visual {
    order: 2;
}

.feature-block.reversed .feature-text {
    order: 1;
}

.feature-visual {
    display: grid;
    place-items: center;
}

.device-frame {
    margin: 0;
    padding: 12px;
    background: #0f172a;
    border-radius: 32px;
    box-shadow: var(--shadow);
    max-width: 280px;
    width: 100%;
}

.device-frame img {
    width: 100%;
    border-radius: 22px;
    background: var(--bg-body);
}

.feature-text h2 {
    font-size: clamp(1.3rem, 2.8vw, 1.7rem);
    font-weight: 800;
    line-height: 1.3;
    margin-bottom: 14px;
}

.feature-text p {
    color: var(--text-secondary);
}

.feature-text ol,
.feature-text ul {
    padding-left: 1.2rem;
    display: grid;
    gap: 10px;
    color: var(--text-secondary);
    margin-top: 12px;
}

.feature-text h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-top: 18px;
    margin-bottom: 8px;
}

.feature-text h3:first-child {
    margin-top: 0;
}

/* ── Minecraft server page (compact) ──────────────── */

.app-hero--compact {
    padding: 8px 0 28px;
}

.app-hero--compact .app-title {
    font-size: clamp(1.6rem, 5vw, 2.6rem);
    margin-bottom: 8px;
}

.app-hero--compact .app-tagline {
    margin-bottom: 18px;
}

.app-logo-lg--compact {
    width: 80px;
    height: 80px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.server-address-bar {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 10px 18px;
    margin-bottom: 18px;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.server-address-bar:hover {
    background: rgba(15, 23, 42, 0.88);
    border-color: var(--accent);
}

.server-address-bar.is-copied {
    border-color: #2ecc71;
}

.server-address {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: clamp(1.3rem, 3vw, 1.7rem);
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.copy-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.server-address-bar:hover .copy-hint {
    color: var(--accent);
}

.server-address-bar.is-copied .copy-hint {
    color: #2ecc71;
}

.btn--small {
    padding: 8px 14px;
    font-size: 0.85rem;
}

.section--compact {
    margin-bottom: 20px;
}

.mc-info-grid,
.mc-bottom-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
}

.mc-info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 20px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.mc-info-card h2 {
    font-size: 1.1rem;
    font-weight: 800;
    margin-bottom: 14px;
    line-height: 1.3;
}

.mc-info-list {
    display: grid;
    gap: 10px;
}

.mc-info-list dt {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.mc-info-list dd {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.mc-join-column {
    display: grid;
    gap: 14px;
}

.mc-join-column h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.mc-join-column p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.mc-news-list,
.mc-rule-list {
    display: grid;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.mc-news-list time {
    display: inline-block;
    color: var(--text-muted);
    font-size: 0.78rem;
    margin-right: 6px;
}

.mc-rule-list {
    list-style: disc;
    padding-left: 1.1rem;
}

@media (max-width: 800px) {
    .mc-info-grid,
    .mc-bottom-grid {
        grid-template-columns: 1fr;
    }

    .server-address-bar {
        width: 100%;
        max-width: 320px;
    }

    .server-address {
        font-size: 1.2rem;
    }

    .app-hero {
        padding: 16px 0 40px;
    }
}

body.minecraft-page {
    background-image: url('/minecraft.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    font-family: var(--font-main), sans-serif;
}

body.minecraft-page .sidebar,
body.minecraft-page .sidebar a,
body.minecraft-page .sidebar-logo {
    font-family: var(--font-main), sans-serif;
}

body.minecraft-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(10, 16, 30, 0.78);
    z-index: -1;
}

.minecraft-content {
    font-family: var(--font-main), sans-serif;
}

.minecraft-content .app-title,
.minecraft-content .app-tagline,
.minecraft-content .server-address,
.minecraft-content .btn,
.minecraft-content .mc-info-card,
.minecraft-content .mc-info-card h2,
.minecraft-content .mc-info-card h3,
.minecraft-content .mc-info-list,
.minecraft-content .mc-news-list,
.minecraft-content .mc-rule-list,
.minecraft-content .content-footer,
.minecraft-content code {
    font-family: var(--font-main), sans-serif;
}

.minecraft-content .mc-info-card {
    background: rgba(15, 23, 42, 0.88);
    color: #f8fafc;
    font-size: 1.15rem;
    text-align: center;
}

.minecraft-content .mc-info-card h2 {
    font-size: 1.5rem;
    color: #f8fafc;
    margin-bottom: 20px;
    text-align: center;
}

.minecraft-content .mc-info-card h3 {
    font-size: 1.2rem;
    color: #f8fafc;
    margin-bottom: 10px;
    text-align: center;
}

.minecraft-content .mc-info-list {
    font-size: 1.15rem;
    text-align: center;
}

.minecraft-content .mc-info-list dt {
    font-size: 0.9rem;
    text-align: center;
}

.minecraft-content .mc-info-list dd {
    text-align: center;
}

.minecraft-content .mc-news-list,
.minecraft-content .mc-rule-list {
    font-size: 1.1rem;
    text-align: center;
    list-style: none;
    padding-left: 0;
}

.minecraft-content .mc-join-column {
    text-align: center;
}

.minecraft-content .mc-join-column p {
    font-size: 1.1rem;
    text-align: center;
}

.minecraft-content .server-address-bar {
    background: rgba(15, 23, 42, 0.88);
}

.minecraft-content .server-address-bar:hover {
    background: rgba(15, 23, 42, 0.95);
}

.minecraft-content .content-footer {
    color: #cbd5e1;
}

@media (max-width: 800px) {
    .feature-block {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 48px 0;
        text-align: center;
    }

    .feature-block.reversed .feature-visual,
    .feature-block.reversed .feature-text {
        order: unset;
    }

    .faq-list {
        gap: 0;
    }
}

.faq-list {
    display: grid;
    gap: 14px;
}

.faq-item {
    padding: 18px 0;
    border-bottom: 1px solid var(--border);
}

.faq-item:last-child {
    border-bottom: none;
}

.faq-item dt {
    font-weight: 700;
    margin-bottom: 8px;
}

.faq-item dd {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.faq-item a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.faq-item a:hover {
    color: var(--accent-hover);
}

.disclaimer {
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
}

/* ── Blog list ────────────────────────────────────── */

.memo-list {
    display: grid;
    gap: 8px;
}

.memo-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.memo-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: color 0.2s ease;
}

.memo-card:hover .memo-card-title {
    color: var(--accent);
}

.memo-card-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.04em;
}

.memo-card-desc {
    font-size: 0.95rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.memo-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.memo-tags li {
    padding: 3px 9px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--text-muted);
    font-size: 0.75rem;
    line-height: 1.4;
}

.post-header-tags {
    margin-top: 14px;
}

.memo-card-tags {
    margin-top: 4px;
}

/* ── Blog post ────────────────────────────────────── */

.post-header {
    margin-bottom: 40px;
}

.post-title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.25;
    margin-bottom: 14px;
}

.post-date {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.post-body {
    color: var(--text-secondary);
    line-height: 1.95;
}

.post-body h2,
.post-body h3,
.post-body h4 {
    color: var(--text-primary);
    margin-top: 2em;
    margin-bottom: 0.7em;
    line-height: 1.35;
}

.post-body h2 {
    font-size: 1.35rem;
}

.post-body h3 {
    font-size: 1.15rem;
}

.post-body p + p {
    margin-top: 1.2em;
}

.post-body a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-body a:hover {
    color: var(--accent-hover);
}

.post-body ul,
.post-body ol {
    padding-left: 1.5rem;
    margin: 1em 0;
}

.post-body li + li {
    margin-top: 0.4em;
}

.post-body code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.08);
    padding: 0.15em 0.4em;
    border-radius: 6px;
}

.post-body pre {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 18px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 1.2em 0;
}

.post-body pre code {
    background: transparent;
    padding: 0;
}

.post-body hr {
    border: none;
    border-top: 1px solid var(--border-strong);
    margin: 2.5em 0;
}

.post-body figure {
    margin: 1.5em 0;
}

.post-body figure img {
    width: 100%;
    border-radius: var(--radius-sm);
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.post-body figcaption {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.88rem;
    margin-top: 10px;
}

.post-body blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    color: var(--text-secondary);
    font-style: italic;
    margin: 1.5em 0;
}

.callout {
    padding: 18px 20px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    margin: 1.5em 0;
    line-height: 1.7;
}

.callout-info {
    background: rgba(56, 189, 248, 0.1);
    border-left: 4px solid var(--accent);
}

.callout-warning {
    background: rgba(249, 115, 22, 0.1);
    border-left: 4px solid var(--accent-warm);
    color: #fed7aa;
}

.post-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 0.95rem;
}

.post-body th,
.post-body td {
    border: 1px solid var(--border);
    padding: 12px 14px;
    text-align: left;
}

.post-body th {
    background: rgba(255, 255, 255, 0.06);
    font-weight: 700;
}

.embed-figure {
    margin: 1.5em 0;
}

.embed-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-sm);
    background: rgba(15, 23, 42, 0.7);
}

.embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.post-footer {
    margin-top: 64px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* ── Error page ───────────────────────────────────── */

.error-page {
    min-height: 60vh;
    display: grid;
    place-items: center;
    text-align: center;
}

.error-code {
    font-family: 'Artemis Inter', var(--font-main), sans-serif;
    font-size: clamp(4rem, 12vw, 7rem);
    font-weight: 900;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 16px;
}

.error-title {
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    color: var(--text-secondary);
    margin-bottom: 32px;
}

/* ── Settings modal (font switcher) ───────────────── */

.sidebar-settings {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.sidebar-settings svg {
    width: 15px;
    height: 15px;
}

.sidebar-settings:hover,
.sidebar-settings:focus-visible {
    color: var(--text-primary);
    border-color: var(--border-strong);
    background: var(--bg-card-hover);
    outline: none;
}

.settings-modal {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(440px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    padding: 0;
    overflow: auto;
    color-scheme: dark;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-body-2);
    color: var(--text-primary);
    box-shadow: var(--shadow);
}

.settings-modal::backdrop {
    background: rgba(2, 6, 23, 0.66);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
}

.settings-form {
    padding: 24px;
}

.settings-title {
    font-family: 'Artemis Inter', var(--font-main), sans-serif;
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 8px;
}

.settings-desc {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 18px;
}

.settings-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.settings-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.settings-option:hover {
    background: var(--bg-card-hover);
}

.settings-option:has(input:checked) {
    border-color: var(--accent);
}

.settings-option input {
    flex: none;
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
    cursor: pointer;
}

.settings-option-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.settings-option-name {
    font-size: 0.82rem;
    font-weight: 600;
}

.settings-option-sample {
    font-size: 0.9rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
}

.settings-actions .btn {
    min-height: 40px;
    padding: 9px 20px;
}

/* ── Photos (Unsplash gallery) ────────────────────── */

.photos-header {
    padding: 8px 0 36px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.photos-title {
    font-family: 'Artemis Inter', var(--font-main), sans-serif;
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 12px;
}

.photos-lead {
    max-width: 680px;
    color: var(--text-secondary);
    line-height: 1.8;
}

.photos-lead a,
.photos-status a,
.photos-footer a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.photos-lead a:hover,
.photos-status a:hover,
.photos-footer a:hover {
    color: var(--accent-hover);
}

.photo-grid {
    columns: 3;
    column-gap: 16px;
}

.photo-grid.is-empty {
    columns: 1;
}

.photo-card {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 16px;
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.photo-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
}

.photo-card-button {
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: var(--photo-color, var(--bg-body-2));
    line-height: 0;
    cursor: zoom-in;
}

.photo-card-button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
}

.photo-card-button img {
    width: 100%;
    height: auto;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.photo-card:hover .photo-card-button img {
    transform: scale(1.025);
}

.photo-card-caption {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 13px 12px;
}

.photo-card-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.5;
}

.photo-card-credit {
    color: var(--text-muted);
    font-size: 0.72rem;
    line-height: 1.5;
}

.photo-card-credit a {
    color: var(--text-secondary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.photo-card-credit a:hover {
    color: var(--accent);
}

.photo-empty {
    column-span: all;
    padding: 48px 20px;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
    background: rgba(15, 23, 42, 0.35);
    color: var(--text-muted);
    text-align: center;
}

.photos-status {
    margin-top: 20px;
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.04em;
}

.photos-footer {
    margin-top: 56px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.8rem;
    line-height: 1.7;
}

/* Photo lightbox */

body.lightbox-open {
    overflow: hidden;
}

.photo-lightbox {
    position: fixed;
    inset: 0;
    margin: auto;
    width: min(1100px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    padding: 0;
    overflow: hidden;
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    background: var(--bg-body-2);
    box-shadow: var(--shadow);
}

.photo-lightbox::backdrop {
    background: rgba(2, 6, 23, 0.84);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.photo-lightbox-inner {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 34px);
    max-height: calc(100dvh - 34px);
}

.photo-lightbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px 8px 16px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-body);
}

.photo-lightbox-count {
    color: var(--text-muted);
    font-size: 0.78rem;
    letter-spacing: 0.08em;
}

.photo-lightbox-close {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
}

.photo-lightbox-close:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--border);
}

.photo-lightbox-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 120px;
    overflow: hidden;
    background: #0f172a;
}

.photo-lightbox-img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 190px);
    max-height: calc(100dvh - 190px);
    object-fit: contain;
}

.photo-lightbox-nav {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    transform: translateY(-50%);
    border: 1px solid var(--border-strong);
    border-radius: 50%;
    background: rgba(11, 17, 32, 0.72);
    color: var(--text-primary);
    cursor: pointer;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    transition: background-color 0.2s ease, opacity 0.2s ease;
}

.photo-lightbox-nav:hover:not(:disabled) {
    background: rgba(51, 65, 85, 0.9);
}

.photo-lightbox-nav:disabled {
    opacity: 0.25;
    cursor: default;
}

.photo-lightbox-nav--prev {
    left: 12px;
}

.photo-lightbox-nav--next {
    right: 12px;
}

.photo-lightbox-meta {
    padding: 14px 18px 16px;
    border-top: 1px solid var(--border);
    background: var(--bg-body);
}

.photo-lightbox-title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    margin-bottom: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.5;
}

.photo-lightbox-credit {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.photo-lightbox-credit a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

@media (max-width: 1024px) {
    .photo-grid {
        columns: 2;
    }
}

@media (min-width: 1500px) {
    .photo-grid {
        columns: 4;
    }
}

@media (max-width: 560px) {
    .photo-grid {
        columns: 1;
    }

    .photos-header {
        padding-bottom: 28px;
        margin-bottom: 24px;
    }

    .photo-lightbox-img {
        max-height: calc(100vh - 210px);
        max-height: calc(100dvh - 210px);
    }

    .photo-lightbox-nav {
        width: 38px;
        height: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .photo-card,
    .photo-card-button img,
    .photo-lightbox-nav {
        transition: none;
    }

    .photo-card:hover .photo-card-button img {
        transform: none;
    }
}
