/* ==========================================================================
   1. Global Styles & Variables (Refreshed)
   - Modern, colorful, readable baseline
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;700;900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=M+PLUS+Rounded+1c:wght@400;700;900&display=swap');

:root {
    --primary-color: #FF6B35; /* Vivid Orange */
    --accent-color: #FFB86B;  /* Soft Peach */
    --accent-2: #FF9E1B;      /* Golden Orange */
    --muted: #7A4C36;
    --text-color: #2B1F16;
    --bg-color: linear-gradient(180deg, #FFF9F3 0%, #FFF2E6 100%);
    --card-bg: rgba(255,255,255,0.94);
    --glass-blur: 8px;
}

/* Cute decorations */
:root {
    --cute-blob: radial-gradient(closest-corner at 30% 30%, rgba(255,184,107,0.18), rgba(255,235,220,0.02));
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    -webkit-font-smoothing:antialiased;
    -moz-osx-font-smoothing:grayscale;
}

/* Hero decorative blob */
.hero {
    position: relative;
}
.hero::before {
    content: '';
    position: absolute;
    width: 220px;
    height: 220px;
    right: -40px;
    top: -30px;
    background: radial-gradient(circle at 30% 30%, rgba(255,184,107,0.18), rgba(255,234,220,0.02));
    border-radius: 50%;
    filter: blur(18px);
    z-index: 0;
}
.hero img { position: relative; z-index: 1; border-radius: 14px; }

/* CAIND ロゴ: サイズのみ制御（エフェクトは適用しない） */
img[alt="CAIND"], img.caind-logo {
    max-width: 96px;
    height: auto;
}

@media (max-width: 576px) {
    img[alt="CAIND"], img.caind-logo { max-width: 72px; }
}
/* Decorative candies */
.candies {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0; /* placed above hero background but below image */
}

.candy {
    --rot: -8deg;
    position: absolute;
    width: 64px;
    height: 36px;
    border-radius: 40px;
    background: repeating-linear-gradient(90deg, #fff 0 8px, rgba(255,184,107,0.95) 8px 16px);
    box-shadow: 0 8px 18px rgba(16,24,40,0.08);
    transform: rotate(var(--rot));
    opacity: 0.98;
    display: block;
    animation: candy-float 6s ease-in-out infinite;
}

.candy::before,
.candy::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 20px;
    height: 18px;
    background: linear-gradient(90deg, rgba(255,184,107,0.95), rgba(255,150,90,0.95));
    border-radius: 50%;
    transform: translateY(-50%);
    box-shadow: inset 0 -2px 4px rgba(0,0,0,0.06);
}

.candy::before { left: -10px; transform: translateY(-50%) rotate(-20deg); }
.candy::after { right: -10px; transform: translateY(-50%) rotate(20deg); }

.candy-1 { left: 6%; top: 6%; --rot: -6deg; animation-duration:5.6s; }
.candy-2 { right: 8%; top: 12%; --rot: 12deg; width:54px; height:30px; animation-duration:6.8s; }
.candy-3 { left: 46%; bottom: -6%; --rot: -18deg; width:72px; height:42px; animation-duration:7.2s; }

@keyframes candy-float {
    0% { transform: rotate(var(--rot)) translateY(0); }
    50% { transform: rotate(var(--rot)) translateY(-10px); }
    100% { transform: rotate(var(--rot)) translateY(0); }
}

/* Lollipop decorations */
.lollipop {
    position: absolute;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(180deg, #fff 0%, #ffd6b3 40%, #ff9e9e 100%);
    box-shadow: 0 8px 18px rgba(16,24,40,0.08);
    display: block;
    transform-origin: 50% 120%;
    animation: lollipop-sway 4.8s ease-in-out infinite;
}

.lollipop::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: -36px;
    transform: translateX(-50%);
    width: 4px;
    height: 36px;
    background: linear-gradient(180deg, #f4e6d8, #d7b89a);
    border-radius: 2px;
    box-shadow: 0 4px 8px rgba(16,24,40,0.06);
}

.lollipop-1 { left: 18%; top: 22%; width:34px; height:34px; animation-duration:5.2s; }
.lollipop-2 { right: 18%; top: 28%; width:30px; height:30px; animation-duration:4.4s; }

@keyframes lollipop-sway {
    0% { transform: rotate(-6deg) translateY(0); }
    50% { transform: rotate(8deg) translateY(-8px); }
    100% { transform: rotate(-6deg) translateY(0); }
}

/* ==========================================================================
   2. Components
   ========================================================================== */

/* Tab Navigation */
.nav-tabs {
    border-bottom: none;
    margin-bottom: 1.25rem;
}

.nav-tabs .nav-item {
    margin: 0 0.5rem;
    flex: 1;
    max-width: 300px;
    display: flex;
}

.nav-tabs .nav-link {
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 0.6rem;
    background: linear-gradient(180deg, rgba(255,255,255,0.9), rgba(250,250,255,0.8));
    transition: transform 0.28s cubic-bezier(.2,.9,.3,1), box-shadow .28s;
    position: relative;
    height: 76px;
}

.nav-tabs .nav-link:hover {
    border-color: var(--primary-color);
    background-color: rgba(255, 218, 185, 0.2);
    transform: translateY(-2px);
}

.nav-tabs .nav-link.active {
    background: linear-gradient(90deg, rgba(255,107,53,0.08), rgba(255,184,107,0.03));
    box-shadow: 0 8px 20px rgba(16,24,40,0.06);
    transform: translateY(-6px);
}

.nav-tabs .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.nav-tabs .nav-link:hover::after {
    transform: scaleX(1);
}

.nav-tabs .nav-link img {
    max-height: 56px;
    width: auto;
    object-fit: contain;
    transition: transform 0.36s ease;
    padding: 6px;
}

.nav-tabs .nav-link:hover img {
    transform: scale(1.05);
}

/* Navbar */
.navbar {
    background: transparent;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-weight: 700;
    color: var(--text-color);
    letter-spacing: -0.02em;
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
    font-size: 0.95rem;
}

.logo-text h1 { margin: 0; }

/* Cards */
.card {
    background: var(--card-bg);
    border: none;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(16,24,40,0.06);
    margin-bottom: 1.5rem;
    transition: transform 0.28s ease, box-shadow 0.28s ease;
    backdrop-filter: blur(var(--glass-blur));
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 48px rgba(16,24,40,0.12);
}

.card-body {
    padding: 1.5rem;
    position: relative;
}

.card-title {
    color: var(--primary-color);
    font-weight: 800;
    font-family: 'M PLUS Rounded 1c', 'Noto Sans JP', sans-serif;
}

/* Buttons */
.btn-primary {
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border: none;
    color: #fff;
    padding: 0.6rem 0.9rem;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(255,107,53,0.12);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 20px 36px rgba(255,107,53,0.14);
}

/* Footer */
.footer {
    background: linear-gradient(90deg, rgba(255,107,53,0.06), rgba(255,184,107,0.03));
    text-align: center;
    padding: 1.75rem 0;
    margin-top: 3rem;
    color: var(--muted);
}

/* ==========================================================================
   3. Page-specific Styles
   ========================================================================== */

/* Section Titles */
.section-title {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Avatar */
.avatar {
    max-width: 160px;
    height: auto;
    border: 6px solid rgba(255,255,255,0.95);
    box-shadow: 0 8px 20px rgba(16,24,40,0.08);
    border-radius: 50%;
    position: relative;
}

/* small heart badge on avatar */
.avatar-wrap { position: relative; display: inline-block; }
.avatar-wrap::after {
    content: '❤';
    position: absolute;
    right: -6px;
    bottom: -6px;
    background: linear-gradient(90deg, var(--accent-color), var(--accent-2));
    color: white;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    box-shadow: 0 6px 16px rgba(16,24,40,0.12);
}
}

/* Social & Contact Links */
.social-links a {
    font-size: 1.2rem;
    margin: 0 0.5rem;
    color: var(--muted);
    transition: color 0.22s ease, transform 0.22s ease;
}

.social-links a:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
}

.other-social-links {
    margin-top: 1rem;
}

.other-social-links a {
    font-size: 1.5rem;
    margin: 0 0.75rem;
}
/* small inline SVG icon for social buttons */
.social-svg {
    width: 20px;
    height: 20px;
    display: inline-block;
}

/* Social buttons: brand backgrounds with white text */
.social-btn {
    color: #fff !important;
    border: none !important;
    padding: 0.42rem 0.7rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    box-shadow: 0 8px 18px rgba(16,24,40,0.06);
    transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}
.social-btn:hover {
    transform: translateY(-3px);
    filter: brightness(0.95);
    text-decoration: none;
}

.social-x { background: linear-gradient(90deg,#1DA1F2,#0d8ce6); }
.social-instagram { background: linear-gradient(45deg,#f58529,#dd2a7b,#8134af,#515bd4); }
.social-bluesky { background: #00a3ff; }
.social-nico { background: #252525; }
.social-steam { background: #171a21; }
.social-amazon { background: #ff9900; }

/* Make inline icons size-match the text and keep contrast */
.social-btn .social-svg { width: 1.05em; height: 1.05em; }
.social-btn i { font-size: 1.05em; }
/* Header responsive tweaks */
header .logo-text { white-space: nowrap; }
header nav .btn { white-space: nowrap; }

@media (max-width: 576px) {
    header .logo-text { font-size: 0.95rem; }
    header nav .btn { font-size: 0.82rem; padding: 0.35rem 0.6rem; }
}
/* Work Section */
.work-img {
    max-width: 100%;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}

/* Works: responsive card grid (将来的に項目が増えても崩れない) */
.works-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    align-items: stretch;
}

.work-card, .work-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(250,250,255,0.9));
    border-radius: 14px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(16,24,40,0.06);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.work-card:hover, .work-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 48px rgba(16,24,40,0.10);
}

.work-card .work-img, .work-item .work-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    border-top-left-radius: 14px;
    border-top-right-radius: 14px;
    margin-bottom: 0;
}

.work-card .work-body, .work-item .work-body {
    padding: 1rem 1rem 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.work-card .work-title, .work-item .work-title {
    font-weight: 800;
    color: var(--primary-color);
    margin: 0;
}

.work-card .work-excerpt, .work-item .work-excerpt {
    color: var(--text-color);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-top: 0.25rem;
}

.work-badge {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

@media (max-width: 576px) {
    .works-grid { gap: 0.75rem; }
    .work-card, .work-item { border-radius: 12px; }
}

.work-item {
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    background: linear-gradient(180deg, rgba(255,255,255,0.6), rgba(250,250,255,0.8));
    transition: transform 0.2s ease, box-shadow 0.25s ease;
    height: 100%;
}

.work-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 32px rgba(16,24,40,0.09);
}

/* Section title cute underline */
.section-title { position: relative; }
.section-title::after {
    content: '✦';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: -18px;
    color: var(--accent-color);
    font-size: 18px;
    opacity: 0.9;
}

.work-caption {
    margin-top: 0.5rem;
}

.placeholder-img {
    opacity: 0.5;
    filter: grayscale(50%);
}

#kabata h3 {
    margin-top: 1.5rem;
}

#discord-btn {
    background: linear-gradient(90deg, #7289da, #5b6bd6);
    border: none;
    color: #fff;
}

.contact-details p {
    font-size: 1rem;
    color: var(--muted);
}

/* X and Niconico Link Styles */
.x, .nico {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    margin-bottom: 10px;
    border-radius: 8px;
    text-decoration: none;
    transition: transform 0.2s;
    color: #FFFFFF;
}

.x:hover, .nico:hover {
    transform: scale(1.02);
}

.x {
    background-color: #000000;
}

.nico {
    background-color: #252525;
}

.x a, .nico a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1rem;
}

.x-icon, .nico-icon {
    width: 24px;
    height: auto;
    margin-right: 12px;
}

#blog-posts .list-group-item {
    background: transparent;
    border-left: 4px solid rgba(255,107,53,0.06);
    padding-left: 1rem;
}

#blog-posts .list-group-item:hover {
    background: rgba(255,255,255,0.6);
}

#blog-posts h5 {
    color: var(--muted);
    font-weight: 700;
}

.contact-section {
    margin-top: 5rem;
}

#past-works {
    text-align: center; /* Center the inline-block ul */
}

#past-works ul {
    list-style-type: none;
    padding-left: 0;
    display: inline-block; /* Fit width to content */
    text-align: left; /* Align text inside the list to the left */
}

#past-works > ul > li {
    font-weight: bold;
    margin-top: 1rem;
}

#past-works > ul > ul {
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

#past-works > ul > ul > li {
    list-style-type: '・'; /* Custom bullet */
    padding-left: 0.5rem;
}

/* Skills List Group */
.list-group-item-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--text-color);
}

.list-group-item-info {
    background-color: #a7d8de; /* A light blue color */
    border-color: #a7d8de;
    color: var(--text-color);
}

.list-group-item h6 {
    color: var(--text-color);
}