/* Reset & Base */
:root {
    --bg-color: #ffffff;
    --text-color: #000;
    --gray-text: #565656;
    --card-bg: #fff;
    --card-hover: #fcfcfc;
    --font-inter: 'Inter', sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --radius-lg: 24px;
    --radius-md: 16px;
}

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

body {
    font-family: var(--font-inter);
    background-color: var(--bg-color);
    color: var(--text-color);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    justify-content: center;
}

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

/* Layout */
.main-container {
    width: 100%;
    max-width: 1400px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

@media (min-width: 1024px) {
    .main-container {
        flex-direction: row;
        align-items: flex-start;
        padding: 64px;
        gap: 80px;
    }
}

/* Profile Section */
.profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 40px;
    width: 100%;
    max-width: 400px;
}

@media (min-width: 1024px) {
    .profile-section {
        align-items: flex-start;
        text-align: left;
        position: sticky;
        top: 64px;
    }
}

.avatar-wrapper {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    border-radius: 50%;
    overflow: hidden;
    /* Phantom border effect optional */
}

@media (min-width: 1024px) {
    .avatar-wrapper {
        width: 184px;
        height: 184px;
    }
}

.avatar {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-content .name {
    font-size: 32px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
}

@media (min-width: 1024px) {
    .profile-content .name {
        font-size: 44px;
        letter-spacing: -2px;
    }
}

.profile-content .bio {
    color: var(--gray-text);
    font-size: 16px;
    line-height: 1.5;
}

@media (min-width: 1024px) {
    .profile-content .bio {
        font-size: 20px;
    }
}

/* Bento Grid */
.bento-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    width: 100%;
    max-width: 400px; /* Mobile width */
}

@media (min-width: 1024px) {
    .bento-grid {
        max-width: 820px; /* Desktop width */
        grid-template-columns: repeat(4, 1fr); /* Standard 4 col */
        grid-auto-rows: 180px; /* Fixed height rows */
        gap: 24px;
    }
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 180px; /* Mobile height default */
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 24px;
    justify-content: space-between;
}

.centered {
    justify-content: center;
    align-items: center;
}

/* Specific Card Styling */

/* Email Card */
.email-card {
    background-color: #ffffff;
    color: #000;
}

@media (min-width: 1024px) {
    .email-card {
        grid-column: span 4;
        height: 80px; /* Shorter for just text */
        grid-row: 3; /* Position manually if needed, or let auto-flow work. Based on Bento: Email was wide. */
    }
}
/* Reordering for desktop to match original: 
   Original Order in JSON: 
   1. Twitter
   2. GitHub
   3. Discord
   4. Email
   5. LINE
   6. Qiita
   
   Grid Implementation:
   We can use grid-area or placement.
*/

/* Twitter */
.twitter-card {
    background-color: #F5FAFE;
    /* border: 1px solid #e1f0fa; */
}
@media (min-width: 1024px) {
    .twitter-card {
        grid-column: span 2;
        grid-row: span 1;
    }
}

/* GitHub */
.github-card {
    background-color: #ffffff;
}
@media (min-width: 1024px) {
    .github-card {
        grid-column: span 2;
        grid-row: span 1;
    }
}

/* Qiita */
.qiita-card {
    background-color: #fff;
}
@media (min-width: 1024px) {
    .qiita-card {
        grid-column: span 2;
        grid-row: span 1;
    }
}

/* LINE */
.line-card {
    background-color: #fff;
}
@media (min-width: 1024px) {
    .line-card {
        grid-column: span 2;
        grid-row: span 1;
    }
}

/* Discord */
.discord-card {
    background-color: #fff;
}
@media (min-width: 1024px) {
    .discord-card {
        grid-column: span 2;
        grid-row: span 1;
    }
}

/* Email again to fix order */
/* 
   Let's try to order them logically in HTML or use order property.
   Current HTML order: Email, Twitter, GitHub, Qiita, LINE, Discord.
   Let's target specific grid positions for Desktop matches.
   Top Row: Twitter, GitHub. 
   Next Row: Qiita ... wait, Qiita was at x=4? 
   If we have 4 columns.
   Row 1: Twitter (2col), GitHub (2col).
   Row 2: Email (4col).
   Row 3: LINE (2col), Discord (2col).
   Where does Qiita go?
   The user had Qiita at x=4? Maybe the user had a wider grid.
   I will put Qiita next to GitHub if I can, but 4 cols is standard.
   Let's put Qiita in Row 4? Or maybe make grid 6 cols?
   If 6 cols:
   Twitter (2), GitHub (2), Qiita (2). -> Row 1 full.
   Email (4) -> x=0. spans 4.
   LINE (2), Discord (2).
   
   Let's try 6 columns for Desktop.
*/
@media (min-width: 1200px) {
    .bento-grid {
        grid-template-columns: repeat(6, 1fr);
        max-width: 1200px;
    }
    .twitter-card { grid-column: span 2; }
    .github-card { grid-column: span 2; }
    .qiita-card { grid-column: span 2; }
    
    .email-card { 
        grid-column: span 6; /* Full width */
        grid-row: 2;
        height: 100px;
    }
    
    .line-card { grid-column: span 3; grid-row: 3; }
    .discord-card { grid-column: span 3; grid-row: 3; }
}

/* Inner Card Styling */
.brand-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
}
.brand-img {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: contain;
}

.icon-wrapper {
    margin-bottom: auto;
}

.card-details {
    margin-top: 16px;
}

.card-title {
    display: block;
    font-weight: 600;
    font-size: 16px;
}

.card-handle {
    display: block;
    color: var(--gray-text);
    font-size: 14px;
    margin-top: 2px;
}

.follow-btn {
    margin-top: 12px;
    background: #000;
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    width: fit-content;
    display: none; /* Only show on some if desired */
}

/* Show follow button on Twitter/Github? Original has it styled. */
.twitter-card .follow-btn {
    display: block;
    background-color: #000;
    color: #fff;
}
.github-card .follow-btn {
    display: none; /* Original didn't seem to focus on it */
}

/* Email text styling */
.email-text {
    font-weight: 600;
    font-size: 18px;
    margin-left: 12px;
}
.emoji {
    font-size: 24px;
}

/* Mobile Tweaks */
@media (max-width: 768px) {
    .card {
        height: auto;
        min-height: 140px;
    }
    .email-card {
        min-height: 80px;
    }
}
