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

/* ── MODERN APPLE & LUXURY GLASS DESIGN SYSTEM — COLOR TOKENS ── */
:root {
    /* Backgrounds */
    --bg: #0a0b0e;
    --bg2: rgba(22, 25, 35, 0.75);
    --bg3: rgba(32, 36, 50, 0.6);
    --bg-solid: #13151c;
    --bg-elevated: #1c202b;

    /* Borders */
    --border: rgba(255, 255, 255, 0.08);
    --border2: rgba(255, 255, 255, 0.18);

    /* Accent */
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-subtle: rgba(0, 113, 227, 0.15);
    --accent-gradient: linear-gradient(135deg, #0071e3 0%, #38bdf8 100%);

    /* Text */
    --text: #f8fafc;
    --text-secondary: rgba(248, 250, 252, 0.65);
    --text-tertiary: rgba(248, 250, 252, 0.42);

    /* Effects */
    --glass-bg: rgba(20, 24, 33, 0.65);
    --glass-blur: 24px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.6);
    --shadow-glow: 0 0 25px rgba(0, 113, 227, 0.25);

    /* Spring-like easing curves */
    --ease-spring: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);

    /* Spacing & Radii */
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 22px;
    --radius-xl: 28px;
}

/* ── LIGHT THEME ── */
html[data-theme="light"] {
    --bg: #f6f8fc;
    --bg2: rgba(255, 255, 255, 0.82);
    --bg3: rgba(240, 243, 250, 0.85);
    --bg-solid: #ffffff;
    --bg-elevated: #edf2fa;

    --border: rgba(0, 0, 0, 0.07);
    --border2: rgba(0, 0, 0, 0.15);

    --accent: #0071e3;
    --accent-hover: #0077ed;
    --accent-subtle: rgba(0, 113, 227, 0.09);
    --accent-gradient: linear-gradient(135deg, #0071e3 0%, #0284c7 100%);

    --text: #0f172a;
    --text-secondary: rgba(15, 23, 42, 0.62);
    --text-tertiary: rgba(15, 23, 42, 0.4);

    --glass-bg: rgba(255, 255, 255, 0.78);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
    --shadow-glow: 0 0 25px rgba(0, 113, 227, 0.15);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--bg);
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 113, 227, 0.15), transparent 100%),
        radial-gradient(circle at 90% 20%, rgba(139, 92, 246, 0.08), transparent 45%),
        radial-gradient(circle at 10% 60%, rgba(56, 189, 248, 0.06), transparent 40%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    line-height: 1.6;
}

html[data-theme="light"] body {
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% -20%, rgba(0, 113, 227, 0.08), transparent 100%),
        radial-gradient(circle at 90% 20%, rgba(139, 92, 246, 0.05), transparent 45%),
        radial-gradient(circle at 10% 60%, rgba(56, 189, 248, 0.04), transparent 40%);
}

.container {
    max-width: 740px;
    margin: 0 auto;
    padding: 0 1.5rem;
    position: relative;
    z-index: 1;
}

/* ── NAV — Floating Glass Island Header ── */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1.4rem;
    margin-top: 0.8rem;
    margin-bottom: 3.5rem;
    position: sticky;
    top: 0.8rem;
    z-index: 100;
    background: var(--glass-bg);
    backdrop-filter: saturate(200%) blur(28px);
    -webkit-backdrop-filter: saturate(200%) blur(28px);
    border: 1px solid var(--border2);
    border-radius: 100px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35), 0 0 20px rgba(0, 113, 227, 0.12), inset 0 1px 1px rgba(255, 255, 255, 0.1);
    transition: all 0.3s var(--ease-out);
}

html[data-theme="light"] nav {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06), 0 0 15px rgba(0, 113, 227, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.nav-logo {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(0, 113, 227, 0.08);
    border: 1px solid rgba(0, 113, 227, 0.25);
    transition: all 0.3s var(--ease-spring);
    flex-shrink: 0;
}

.nav-logo::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #0071e3;
    box-shadow: 0 0 10px #0071e3;
    animation: logoPulse 3s infinite ease-in-out;
}

@keyframes logoPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(0.85); }
}

.nav-logo:hover {
    background: rgba(0, 113, 227, 0.18);
    border-color: rgba(0, 113, 227, 0.5);
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 0 16px rgba(0, 113, 227, 0.3);
}

.nav-links {
    display: flex;
    gap: 0.35rem;
    align-items: center;
}

.nav-links a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 6px 14px;
    border-radius: 100px;
    transition: all 0.25s var(--ease-out);
    letter-spacing: -0.01em;
    position: relative;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--text);
    background: var(--bg3);
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
    transform: translateY(-1px);
}

.nav-links a:active {
    transform: scale(0.96);
}

/* ── HERO — Centered Apple-style ── */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
    margin-bottom: 4rem;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeSlideUp 0.8s var(--ease-out) forwards;
}

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

.avatar {
    width: 108px;
    height: 108px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0071e3 0%, #38bdf8 50%, #8b5cf6 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.7rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
    position: relative;
    box-shadow: 0 0 30px rgba(0, 113, 227, 0.4), 0 0 60px rgba(139, 92, 246, 0.25);
    transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.avatar:hover {
    transform: scale(1.06) rotate(3deg);
    box-shadow: 0 0 45px rgba(0, 113, 227, 0.6), 0 0 80px rgba(139, 92, 246, 0.4);
}

.hero-name {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.08;
    background: linear-gradient(135deg, var(--text) 30%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-handle {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.tag-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.tag {
    font-size: 12px;
    font-weight: 600;
    padding: 6px 16px;
    border-radius: 100px;
    border: 1px solid var(--border2);
    color: var(--text-secondary);
    background: var(--bg3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    letter-spacing: 0.01em;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08);
    transition: all 0.3s var(--ease-spring);
}

.tag:hover {
    color: var(--text);
    border-color: var(--accent);
    background: var(--accent-subtle);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 113, 227, 0.15);
}

/* ── SECTION TITLE — Modern Uppercase ── */
.section-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--text-tertiary);
    text-transform: uppercase;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
}

.section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border2) 0%, transparent 100%);
}

/* ── STATS — Glassmorphism Cards ── */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 3rem;
}

.stat-card {
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.6rem 1rem;
    text-align: center;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow-sm);
    transition: transform 0.4s var(--ease-out), border-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring), background 0.3s var(--ease-spring);
}

.stat-card:hover {
    border-color: var(--border2);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(0, 113, 227, 0.12);
    background: var(--bg2);
}

.stat-card:active {
    transform: scale(0.98);
    transition: transform 100ms ease-out;
}

.stat-num {
    font-family: 'Inter', sans-serif;
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(135deg, #0071e3 0%, #38bdf8 50%, #8b5cf6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-tertiary);
    margin-top: 6px;
    letter-spacing: 0.02em;
}

/* ── PROFILE ── */
.profile-card {
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.85rem;
    margin-bottom: 3rem;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow-sm);
}

.bio-text {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

/* ── RESPONSIVE IFRAME ── */
.responsive-iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-md);
    border: none;
    margin-top: 1.25rem;
    box-shadow: var(--shadow-lg);
    display: block;
    background: #000;
}

.pdf-iframe {
    width: 100%;
    height: 520px;
    max-height: 75vh;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-top: 1.25rem;
    box-shadow: var(--shadow-md);
    display: block;
    background: var(--bg2);
}

/* ── VIDEO GRID ── */
.video-section {
    margin-bottom: 3rem;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

#main-videos #main-video-grid,
#sub-videos #sub-video-grid {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 14px;
    padding: 6px 4px 18px 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

#main-videos #main-video-grid .video-card,
#sub-videos #sub-video-grid .video-card,
#main-videos #main-video-grid .skeleton-card,
#sub-videos #sub-video-grid .skeleton-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
}

#main-videos #main-video-grid .video-thumb,
#sub-videos #sub-video-grid .video-thumb,
#main-videos #main-video-grid .skeleton-thumb,
#sub-videos #sub-video-grid .skeleton-thumb {
    aspect-ratio: 16 / 9;
    height: auto;
}

#main-videos #main-video-grid::-webkit-scrollbar,
#sub-videos #sub-video-grid::-webkit-scrollbar {
    height: 4px;
}

#main-videos #main-video-grid::-webkit-scrollbar-track,
#sub-videos #sub-video-grid::-webkit-scrollbar-track {
    background: transparent;
}

#main-videos #main-video-grid::-webkit-scrollbar-thumb,
#sub-videos #sub-video-grid::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 10px;
}

#main-videos #main-video-grid::-webkit-scrollbar-thumb:hover,
#sub-videos #sub-video-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

@media (max-width: 480px) {
    #main-videos #main-video-grid .video-card,
    #sub-videos #sub-video-grid .video-card,
    #main-videos #main-video-grid .skeleton-card,
    #sub-videos #sub-video-grid .skeleton-card {
        flex: 0 0 200px;
    }
}

.video-card {
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s var(--ease-out), border-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring), background 0.3s var(--ease-spring);
    text-decoration: none;
    display: block;
    color: inherit;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow-sm);
}

.video-card:hover {
    border-color: var(--border2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), 0 0 25px rgba(0, 113, 227, 0.12);
    background: var(--bg2);
}

.video-card:active {
    transform: scale(0.97);
    transition: transform 100ms ease-out;
}

.video-thumb {
    width: 100%;
    height: 110px;
    background: var(--bg-elevated);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s var(--ease-out);
}

.video-card:hover .video-thumb img {
    transform: scale(1.06);
}

.play-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s var(--ease-out), background 0.3s var(--ease-spring), border-color 0.3s var(--ease-spring);
    position: relative;
    z-index: 2;
}

.video-card:hover .play-icon {
    transform: scale(1.15);
    background: var(--accent);
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 6px 20px rgba(0, 113, 227, 0.5);
}

.play-icon svg {
    width: 14px;
    height: 14px;
    fill: #fff;
    margin-left: 2px;
}

.video-info {
    padding: 13px 15px 15px;
}

.video-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 6px;
    letter-spacing: -0.01em;
}

.video-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ── LINKS / SNS ── */
.links-section {
    margin-bottom: 3rem;
}

.sns-row {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sns-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.4s var(--ease-out), border-color 0.3s var(--ease-spring), background 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring);
    letter-spacing: -0.01em;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.sns-btn:hover {
    border-color: var(--border2);
    background: var(--bg3);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15), 0 0 15px var(--accent-subtle);
    transform: translateY(-2px);
}

.sns-btn:active {
    transform: scale(0.97);
    transition: transform 100ms ease-out;
}

.sns-btn svg {
    width: 16px;
    height: 16px;
    fill: var(--text-secondary);
    flex-shrink: 0;
    transition: fill 0.3s var(--ease-spring);
}

.sns-btn:hover svg {
    fill: var(--text);
}

/* ── INQUIRY FORM ── */
.inquiry-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.form-group .required {
    font-size: 10px;
    background: rgba(255, 59, 48, 0.12);
    color: #ff453a;
    padding: 2px 7px;
    border-radius: 4px;
    border: 1px solid rgba(255, 59, 48, 0.2);
    font-weight: 600;
}

.inquiry-form input[type="text"],
.inquiry-form input[type="email"],
.inquiry-form input[type="url"],
.inquiry-form select,
.inquiry-form textarea {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 18px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring), background-color 0.3s var(--ease-spring);
    letter-spacing: -0.01em;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.inquiry-form select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230071e3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 18px center;
    background-size: 16px;
    padding-right: 44px;
    cursor: pointer;
}

.inquiry-form select option {
    background-color: var(--bg-solid);
    color: var(--text);
}

.inquiry-form select:invalid,
.inquiry-form select option[value=""] {
    color: var(--text-tertiary);
}

.inquiry-form input[type="text"]:focus,
.inquiry-form input[type="email"]:focus,
.inquiry-form input[type="url"]:focus,
.inquiry-form select:focus,
.inquiry-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    background: var(--bg-solid);
    box-shadow: 0 0 0 4px var(--accent-subtle), 0 0 15px rgba(0, 113, 227, 0.15);
}

.inquiry-form textarea {
    min-height: 150px;
    resize: vertical;
}

/* ── CHECKBOX ── */
.checkbox-group {
    flex-direction: row !important;
    align-items: center;
    gap: 12px;
    margin: 0.5rem 0;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.checkbox-group label a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s;
}

.checkbox-group label a:hover {
    color: var(--accent-hover);
}

.checkbox-group input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--border2);
    border-radius: 6px;
    background: var(--bg3);
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s var(--ease-spring), background-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring);
    flex-shrink: 0;
}

.checkbox-group input[type="checkbox"]:checked {
    background: var(--accent);
    border-color: var(--accent);
}

.checkbox-group input[type="checkbox"]:checked::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-bottom: 2px;
}

.checkbox-group input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 4px var(--accent-subtle);
}

.checkbox-group input[type="checkbox"]:hover {
    border-color: var(--accent);
}

.submit-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    padding: 14px 32px;
    border-radius: var(--radius-sm);
    border: none;
    background: linear-gradient(135deg, #0071e3 0%, #38bdf8 100%);
    color: #fff;
    cursor: pointer;
    transition: background 0.3s var(--ease-spring), transform 0.2s var(--ease-out), box-shadow 0.3s var(--ease-spring);
    margin-top: 0.5rem;
    letter-spacing: -0.01em;
    box-shadow: 0 4px 20px rgba(0, 113, 227, 0.35);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(0, 113, 227, 0.5);
}

.submit-btn:active {
    transform: scale(0.97);
    transition: transform 100ms ease-out;
}

/* ── FORM VALIDATION ERROR STYLES ── */
.form-group.has-error input[type="text"],
.form-group.has-error input[type="email"],
.form-group.has-error input[type="url"],
.form-group.has-error select,
.form-group.has-error textarea {
    border-color: #ff453a !important;
    background-color: rgba(255, 59, 48, 0.05) !important;
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.15) !important;
}

.checkbox-group {
    flex-wrap: wrap;
}

.checkbox-group.has-error input[type="checkbox"] {
    border-color: #ff453a !important;
    background-color: rgba(255, 59, 48, 0.05) !important;
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.15) !important;
}

.error-message {
    font-size: 12px;
    color: #ff453a;
    margin-top: 4px;
    display: inline-flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.4;
    animation: fadeInError 0.25s ease forwards;
}

.checkbox-group .error-message {
    width: 100%;
    margin-top: 8px;
}

.error-message svg {
    color: #ff453a;
    width: 14px;
    height: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

@keyframes fadeInError {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── FOOTER ── */
footer {
    border-top: 1px solid var(--border);
    padding: 3rem 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-tertiary);
    letter-spacing: -0.01em;
}

/* ── NOTICE PAGE & MINI ── */
.notice-section {
    margin-bottom: 3rem;
}

.notice-list-mini {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.notice-item-mini {
    display: block;
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.25rem 1.4rem;
    text-decoration: none;
    color: inherit;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow-sm);
    transition: transform 0.4s var(--ease-out), border-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring), background 0.3s var(--ease-spring);
}

.notice-item-mini:hover {
    border-color: var(--border2);
    transform: translateY(-3px);
    box-shadow: var(--shadow-md), 0 0 20px rgba(0, 113, 227, 0.1);
    background: var(--bg2);
}

.notice-item-mini:active {
    transform: scale(0.98);
    transition: transform 100ms ease-out;
}

.notice-meta-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

.notice-date-mini {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.notice-badge-mini {
    font-size: 10px;
    padding: 3px 10px;
    border-radius: 100px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.badge-youtube {
    background: rgba(255, 59, 48, 0.15);
    color: #ff453a;
    border: 1px solid rgba(255, 59, 48, 0.25);
}

.badge-podcast {
    background: var(--accent-subtle);
    color: var(--accent);
    border: 1px solid rgba(0, 113, 227, 0.25);
}

.badge-info {
    background: rgba(48, 209, 88, 0.15);
    color: #30d158;
    border: 1px solid rgba(48, 209, 88, 0.25);
}

.badge-event {
    background: rgba(255, 149, 0, 0.15);
    color: #ff9500;
    border: 1px solid rgba(255, 149, 0, 0.25);
}

.notice-title-mini {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* Full Notice Page styles */
.notice-filters {
    display: flex;
    gap: 10px;
    margin-bottom: 1.75rem;
    flex-wrap: wrap;
}

.filter-btn {
    font-family: inherit;
    font-size: 12px;
    padding: 8px 18px;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text-secondary);
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s var(--ease-spring);
    letter-spacing: -0.01em;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

.filter-btn:hover, .filter-btn.active {
    color: #fff;
    border-color: var(--accent);
    background: var(--accent-gradient);
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.3);
}

.filter-btn:active {
    transform: scale(0.95);
    transition: transform 100ms ease-out;
}

.notice-card-full {
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1.6rem;
    margin-bottom: 1.25rem;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow-sm);
    transition: border-color 0.3s var(--ease-spring), opacity 0.3s ease, transform 0.3s ease;
}

.notice-card-full:hover {
    border-color: var(--border2);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.notice-card-full.hidden {
    display: none;
}

.notice-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.notice-title-full {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text);
    letter-spacing: -0.02em;
}

.notice-content {
    font-size: 14px;
    line-height: 1.75;
    color: var(--text-secondary);
    white-space: pre-wrap;
}

@media (max-width: 640px) {
    nav {
        padding: 0.5rem 0.8rem;
        margin-top: 0.5rem;
        margin-bottom: 2.5rem;
        top: 0.5rem;
        border-radius: 24px;
    }

    .nav-logo {
        font-size: 12px;
        padding: 4px 9px;
        gap: 6px;
    }

    .nav-links {
        gap: 0.15rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 2px 0;
        max-width: calc(100vw - 120px);
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links a {
        font-size: 11.5px;
        padding: 5px 9px;
        white-space: nowrap;
    }

    .hero {
        flex-direction: column;
        text-align: center;
    }

    .hero-name {
        font-size: 36px;
    }

    .tag-row {
        justify-content: center;
    }

    .stats-row {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── THEME SWITCHER ── */
.theme-toggle-btn {
    background: var(--bg3);
    border: 1px solid var(--border);
    cursor: pointer;
    padding: 7px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    transition: all 0.3s var(--ease-spring);
    outline: none;
    margin-left: 6px;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
}

.theme-toggle-btn:hover {
    color: var(--text);
    background-color: var(--bg-elevated);
    border-color: var(--border2);
    transform: rotate(20deg) scale(1.08);
    box-shadow: 0 0 15px rgba(0, 113, 227, 0.25);
}

.theme-toggle-btn:active {
    transform: scale(0.88);
    transition: transform 100ms ease-out;
}

.theme-toggle-btn svg {
    width: 17px;
    height: 17px;
    fill: currentColor;
}

/* Display icon matching the current theme */
html[data-theme="light"] .sun-icon {
    display: none;
}
html[data-theme="dark"] .moon-icon {
    display: none;
}
html:not([data-theme="light"]) .moon-icon {
    display: none;
}

/* ── VIDEO SEARCH & CONTROLS ── */
.video-controls {
    display: flex;
    gap: 12px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.video-search-wrapper {
    flex: 1;
    min-width: 260px;
    position: relative;
}

.video-search-input {
    width: 100%;
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 18px 11px 42px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    transition: border-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring);
    letter-spacing: -0.01em;
}

.video-search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-subtle);
}

.video-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    fill: var(--text-tertiary);
    pointer-events: none;
}

.video-sort-select {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 38px 11px 18px;
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230071e3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    transition: border-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring);
}

.video-sort-select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-subtle);
}

/* ── SKELETON ANIMATION ── */
.skeleton-card {
    background: var(--glass-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    pointer-events: none;
}

.skeleton-thumb {
    width: 100%;
    height: 110px;
    background: var(--bg-elevated);
    position: relative;
    overflow: hidden;
}

.skeleton-info {
    padding: 13px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.skeleton-line {
    height: 12px;
    background: var(--bg-elevated);
    border-radius: 4px;
    position: relative;
    overflow: hidden;
}

.skeleton-line.title-1 { width: 90%; }
.skeleton-line.title-2 { width: 60%; }
.skeleton-line.meta { width: 40%; height: 10px; }

.skeleton-thumb::after,
.skeleton-line::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.08),
        transparent
    );
    animation: skeleton-shimmer 1.5s infinite;
}

html[data-theme="light"] .skeleton-thumb::after,
html[data-theme="light"] .skeleton-line::after {
    background: linear-gradient(
        90deg,
        transparent,
        rgba(0, 0, 0, 0.05),
        transparent
    );
}

@keyframes skeleton-shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* ── MODERN MODAL PLAYER ── */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s var(--ease-out);
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-solid);
    border: 1px solid var(--border2);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 720px;
    margin: auto;
    box-shadow: var(--shadow-lg), 0 0 50px rgba(0, 113, 227, 0.25);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.4s var(--ease-out);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.6rem;
    border-bottom: 1px solid var(--border);
}

.modal-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 82%;
    letter-spacing: -0.01em;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    border-radius: 50%;
    transition: background-color 0.3s var(--ease-spring), color 0.3s var(--ease-spring);
}

.modal-close-btn:hover {
    background-color: var(--bg3);
    color: var(--text);
}

.modal-close-btn:active {
    transform: scale(0.9);
    transition: transform 100ms ease-out;
}

.modal-close-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.modal-body {
    padding: 0;
}

.modal-video-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    display: block;
}

.modal-video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.modal-footer {
    padding: 1.25rem 1.6rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg3);
    color: var(--text);
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.3s var(--ease-spring), background-color 0.3s var(--ease-spring), transform 0.15s ease-out;
    letter-spacing: -0.01em;
}

.modal-btn:hover {
    border-color: var(--border2);
    background-color: var(--bg-elevated);
}

.modal-btn:active {
    transform: scale(0.95);
    transition: transform 100ms ease-out;
}

.modal-btn.primary {
    background: var(--accent-gradient);
    border: none;
    color: #fff;
    box-shadow: 0 4px 16px rgba(0, 113, 227, 0.35);
}

.modal-btn.primary:hover {
    box-shadow: 0 6px 24px rgba(0, 113, 227, 0.5);
}

.modal-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ── TOAST NOTIFICATION ── */
.toast-container {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    background: var(--bg-solid);
    border: 1px solid var(--border2);
    color: var(--text);
    padding: 13px 26px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    box-shadow: var(--shadow-lg), 0 0 20px rgba(0, 113, 227, 0.15);
    backdrop-filter: saturate(180%) blur(24px);
    -webkit-backdrop-filter: saturate(180%) blur(24px);
    opacity: 0;
    transform: translateY(10px) scale(0.96);
    transition: opacity 0.3s var(--ease-out), transform 0.3s var(--ease-out);
    letter-spacing: -0.01em;
}

.toast.show {
    opacity: 1;
    transform: translateY(0) scale(1);
}

/* ── SUBSCRIBE BUTTON ── */
.subscribe-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, #ff3b30 0%, #e02828 100%);
    color: #fff;
    text-decoration: none;
    transition: transform 0.4s var(--ease-out), box-shadow 0.3s var(--ease-spring), filter 0.3s var(--ease-spring);
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(255, 59, 48, 0.35);
    letter-spacing: -0.01em;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.subscribe-btn:hover {
    filter: brightness(1.1);
    box-shadow: 0 6px 24px rgba(255, 59, 48, 0.5);
    transform: translateY(-2px);
}

.subscribe-btn:active {
    transform: scale(0.97);
    transition: transform 100ms ease-out;
}

.subscribe-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.video-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #fff;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 10px;
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1;
    z-index: 2;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── BLOG SECTION ── */
.blog-section {
    margin-bottom: 3.5rem;
}

.blog-grid {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 14px;
    padding: 6px 4px 18px 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.blog-grid::-webkit-scrollbar {
    height: 4px;
}

.blog-grid::-webkit-scrollbar-track {
    background: transparent;
}

.blog-grid::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 10px;
}

.blog-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.blog-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s var(--ease-out), border-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring), background 0.3s var(--ease-spring);
    text-decoration: none;
    display: block;
    color: inherit;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow-sm);
}

.blog-card:hover {
    border-color: var(--border2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), 0 0 25px rgba(0, 113, 227, 0.12);
    background: var(--bg2);
}

.blog-card:active {
    transform: scale(0.97);
    transition: transform 100ms ease-out;
}

.blog-thumb {
    width: 100%;
    height: 135px;
    background: var(--bg-elevated);
    background-size: cover;
    background-position: center;
    position: relative;
    transition: transform 0.5s var(--ease-out);
}

.blog-card:hover .blog-thumb {
    transform: scale(1.05);
}

.blog-info {
    padding: 13px 15px 15px;
}

.blog-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
    letter-spacing: -0.01em;
}

.blog-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.blog-card.skeleton-card .skeleton-thumb {
    aspect-ratio: 16 / 9;
    height: auto;
}

@media (max-width: 480px) {
    .blog-grid {
        gap: 12px;
    }
    .blog-card {
        flex: 0 0 200px;
    }
    .blog-thumb {
        height: 112.5px;
    }
}

/* ── NOTE SECTION ── */
.note-section {
    margin-bottom: 3.5rem;
}

.note-grid {
    display: flex;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 14px;
    padding: 6px 4px 18px 4px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.note-grid::-webkit-scrollbar {
    height: 4px;
}

.note-grid::-webkit-scrollbar-track {
    background: transparent;
}

.note-grid::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 10px;
}

.note-grid::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

.note-card {
    flex: 0 0 240px;
    scroll-snap-align: start;
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.4s var(--ease-out), border-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring), background 0.3s var(--ease-spring);
    text-decoration: none;
    display: block;
    color: inherit;
    box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05), var(--shadow-sm);
}

.note-card:hover {
    border-color: var(--border2);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md), 0 0 25px rgba(0, 113, 227, 0.12);
    background: var(--bg2);
}

.note-card:active {
    transform: scale(0.97);
    transition: transform 100ms ease-out;
}

.note-thumb {
    width: 100%;
    height: 135px;
    background: var(--bg-elevated);
    background-size: cover;
    background-position: center;
    position: relative;
    transition: transform 0.5s var(--ease-out);
}

.note-card:hover .note-thumb {
    transform: scale(1.05);
}

.note-info {
    padding: 13px 15px 15px;
}

.note-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.45;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
    letter-spacing: -0.01em;
}

.note-meta {
    font-size: 11px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.note-card.skeleton-card .skeleton-thumb {
    aspect-ratio: 16 / 9;
    height: auto;
}

@media (max-width: 480px) {
    .note-grid {
        gap: 12px;
    }
    .note-card {
        flex: 0 0 200px;
    }
    .note-thumb {
        height: 112.5px;
    }
}

/* ── SCROLL ANIMATION ── */
[data-animate] {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}

[data-animate].is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Staggered delays */
[data-animate-delay="1"] { transition-delay: 0.08s; }
[data-animate-delay="2"] { transition-delay: 0.16s; }
[data-animate-delay="3"] { transition-delay: 0.24s; }
[data-animate-delay="4"] { transition-delay: 0.32s; }
[data-animate-delay="5"] { transition-delay: 0.4s; }

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    [data-animate] {
        opacity: 1;
        transform: none;
    }

    .hero {
        opacity: 1;
        transform: none;
        animation: none;
    }
}

/* ── WORKS SECTION ── */
.works-section {
    margin-bottom: 3rem;
}

/* ── TABLE OF CONTENTS (目次) ── */
.toc-card {
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    padding: 1.4rem 1.6rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-md), 0 0 20px rgba(0, 113, 227, 0.08);
    transition: all 0.3s var(--ease-spring);
}

.toc-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

.toc-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    letter-spacing: -0.01em;
}

.toc-toggle-btn {
    background: var(--bg3);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.2s var(--ease-out);
}

.toc-toggle-btn:hover {
    color: var(--text);
    background: var(--bg-elevated);
    border-color: var(--border2);
}

.toc-content {
    margin-top: 1rem;
    transition: max-height 0.3s ease, opacity 0.3s ease;
}

.toc-content.collapsed,
#single-ai-content.collapsed {
    display: none;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-item {
    line-height: 1.5;
}

.toc-item.level-h2 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-top: 6px;
}

.toc-item.level-h3 {
    font-size: 0.88rem;
    font-weight: 500;
    padding-left: 1.2rem;
    position: relative;
}

.toc-item.level-h3::before {
    content: "└";
    position: absolute;
    left: 0.2rem;
    color: var(--text-tertiary);
    font-weight: 400;
}

.toc-item.level-h4 {
    font-size: 0.84rem;
    font-weight: 400;
    padding-left: 2.2rem;
    position: relative;
}

.toc-item.level-h4::before {
    content: "・";
    position: absolute;
    left: 1.4rem;
    color: var(--text-tertiary);
}

.toc-link {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
    display: inline-block;
}

.toc-link:hover {
    color: var(--accent);
    transform: translateX(3px);
}

/* Offset headings for smooth scroll below floating navbar */
.article-body h2[id],
.article-body h3[id],
.article-body h4[id] {
    scroll-margin-top: 100px;
}

/* ── BACK TO TOP BUTTON (上に戻るボタン) ── */
.back-to-top-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 990;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
    border: 1px solid var(--border2);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md), 0 0 20px rgba(0, 113, 227, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.88);
    transition: opacity 0.3s var(--ease-out), visibility 0.3s var(--ease-out), transform 0.3s var(--ease-out), background 0.3s var(--ease-spring), border-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring);
    outline: none;
}

.back-to-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.back-to-top-btn:hover {
    color: #fff;
    background: var(--accent-gradient);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 24px rgba(0, 113, 227, 0.4);
}

.back-to-top-btn:active {
    transform: scale(0.92);
    transition: transform 100ms ease-out;
}

.back-to-top-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
    transition: transform 0.3s ease;
}

.back-to-top-btn:hover svg {
    transform: translateY(-2px);
}

/* ── FLOATING MINI TOC (右下ポップアップ目次) ── */
.floating-toc-btn {
    position: fixed;
    bottom: 84px;
    right: 28px;
    z-index: 991;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--glass-bg);
    backdrop-filter: saturate(180%) blur(var(--glass-blur));
    -webkit-backdrop-filter: saturate(180%) blur(var(--glass-blur));
    border: 1px solid var(--border2);
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-md), 0 0 20px rgba(139, 92, 246, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.88);
    transition: opacity 0.3s var(--ease-out), visibility 0.3s var(--ease-out), transform 0.3s var(--ease-out), background 0.3s var(--ease-spring), border-color 0.3s var(--ease-spring), box-shadow 0.3s var(--ease-spring);
    outline: none;
}

.floating-toc-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.floating-toc-btn:hover,
.floating-toc-btn.active {
    color: #fff;
    background: linear-gradient(135deg, #8b5cf6 0%, #0071e3 100%);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-3px) scale(1.08);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.floating-toc-btn:active {
    transform: scale(0.92);
}

.floating-toc-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Floating TOC Popup Window */
.floating-toc-popup {
    position: fixed;
    bottom: 140px;
    right: 28px;
    z-index: 992;
    width: 290px;
    max-height: 420px;
    background: var(--glass-bg);
    backdrop-filter: saturate(200%) blur(28px);
    -webkit-backdrop-filter: saturate(200%) blur(28px);
    border: 1px solid var(--border2);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg), 0 0 30px rgba(0, 113, 227, 0.2);
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.94);
    transition: opacity 0.3s var(--ease-out), visibility 0.3s var(--ease-out), transform 0.3s var(--ease-out);
    pointer-events: none;
}

.floating-toc-popup.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.floating-toc-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 0.6rem;
    margin-bottom: 0.8rem;
    border-bottom: 1px solid var(--border);
}

.floating-toc-popup-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.floating-toc-popup-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 4px;
    border-radius: 50%;
    transition: color 0.2s ease, background 0.2s ease;
}

.floating-toc-popup-close:hover {
    color: var(--text);
    background: var(--bg3);
}

.floating-toc-popup-body {
    overflow-y: auto;
    max-height: 320px;
    padding-right: 4px;
}

.floating-toc-popup-body::-webkit-scrollbar {
    width: 4px;
}

.floating-toc-popup-body::-webkit-scrollbar-thumb {
    background: var(--border2);
    border-radius: 4px;
}

/* ── TOOLTIPS FOR FLOATING BUTTONS (ボタン真横のラベル表示) ── */
.back-to-top-btn[data-tooltip]::before,
.floating-toc-btn[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    right: 58px;
    top: 50%;
    transform: translateY(-50%) translateX(6px) scale(0.92);
    z-index: 995;
    background: rgba(15, 20, 32, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    border: 1px solid var(--border2);
    padding: 5px 11px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    transition: opacity 0.2s var(--ease-out), visibility 0.2s var(--ease-out), transform 0.2s var(--ease-out);
    letter-spacing: -0.01em;
}

html[data-theme="light"] .back-to-top-btn[data-tooltip]::before,
html[data-theme="light"] .floating-toc-btn[data-tooltip]::before {
    background: rgba(255, 255, 255, 0.92);
    color: var(--text);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.back-to-top-btn[data-tooltip]:hover::before,
.floating-toc-btn[data-tooltip]:hover::before {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0) scale(1);
}

@media (max-width: 640px) {
    .back-to-top-btn[data-tooltip]::before,
    .floating-toc-btn[data-tooltip]::before {
        display: none !important;
    }
}

/* ── READING PROGRESS BAR (画面下の読了率プログレスバー) ── */
.reading-progress-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    pointer-events: none;
}

.reading-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0071e3 0%, #a855f7 50%, #34d399 100%);
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.7), 0 0 4px rgba(52, 211, 153, 0.8);
    transition: width 0.1s ease-out;
    border-radius: 0 2px 2px 0;
}