/* =========================================
   1. STRICT RESET & VARIABLES
   ========================================= */
*, *::before, *::after {
    margin: 0; padding: 0; box-sizing: border-box;
    outline: none; border: none; text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-dark: #09090b;
    --bg-card: #111114;
    --bg-card-hover: #16161a;
    --border-color: #27272a;
    --accent-color: #58a6ff; 
    --accent-glow: 0 0 12px rgba(88, 166, 255, 0.35), 0 0 24px rgba(88, 166, 255, 0.1);
    --text-glow: 0 0 8px rgba(88, 166, 255, 0.5);
    --text-main: #e4e4e7;
    --text-muted: #a1a1aa;
    --font-ui: 'Inter', sans-serif;
    --font-mono: 'JetBrains Mono', monospace;
}

body {
    background-color: var(--bg-dark);
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 32px 32px;
    background-attachment: fixed;
    color: var(--text-main);
    font-family: var(--font-ui);
    min-height: 100vh;
    overflow-x: hidden;
}

/* =========================================
   2. FLUID WRAPPER & CONTAINER
   ========================================= */
.wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    /* Margin dinamis: besar di PC, menempel di layar HP */
    padding: clamp(1rem, 4vw, 3rem) clamp(0.5rem, 3vw, 1.5rem); 
}

.container {
    width: 100%;
    max-width: 768px; /* Ukuran optimal untuk Tablet/Desktop */
    background-color: rgba(13, 17, 23, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in-up { animation: fadeInUp 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* =========================================
   3. TERMINAL HEADER (ANTI-PECAH)
   ========================================= */
.terminal-header {
    background-color: #16161a;
    padding: 0.8rem 1.2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
}

.window-controls { 
    display: flex; 
    gap: 8px; 
    flex: 1; /* Alokasi ruang yang seimbang */
}
.dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.dot.close { background-color: #ff5f56; }
.dot.minimize { background-color: #ffbd2e; }
.dot.maximize { background-color: #27c93f; }

.window-title {
    font-family: var(--font-mono);
    font-size: clamp(0.7rem, 2vw, 0.8rem);
    color: var(--text-muted);
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 10px;
    flex: 2; /* Title mengambil ruang lebih banyak */
}

.spacer { flex: 1; } /* Spacer untuk menjaga keseimbangan posisi flexbox */

/* =========================================
   4. PROFILE HEADER (PRESISI TENGAH)
   ========================================= */
.terminal-body { padding: clamp(1.5rem, 5vw, 2.5rem); }

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 1.25rem;
    margin-bottom: 0.5rem;
}

.logo-container {
    width: clamp(80px, 15vw, 100px);
    height: clamp(80px, 15vw, 100px);
    border-radius: 50%;
    padding: 4px;
    background: var(--bg-dark);
    border: 2px solid var(--border-color);
    box-shadow: var(--accent-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.profile-logo {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.brand-title {
    font-family: var(--font-mono);
    font-size: clamp(1.3rem, 4vw, 1.7rem);
    color: #fff;
    text-shadow: var(--text-glow);
    letter-spacing: -0.5px;
    margin-bottom: 0.4rem;
}

.brand-subtitle {
    color: var(--text-muted);
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    font-family: var(--font-mono);
}

.prompt { color: var(--accent-color); font-weight: bold; }

.divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
    margin: clamp(1.5rem, 4vw, 2.5rem) 0;
}

/* =========================================
   5. GRID LINK CARDS (FLUID LAYOUT)
   ========================================= */
.link-section { margin-bottom: clamp(2rem, 5vw, 3rem); }

.section-title {
    font-family: var(--font-mono);
    font-size: clamp(0.8rem, 2.5vw, 0.9rem);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.section-title i { color: var(--accent-color); font-size: 1.15rem; text-shadow: var(--text-glow); }

/* Grid dinamis: otomatis menyesuaikan kolom berdasarkan ruang yang ada */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
}

.link-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    padding: clamp(1rem, 3vw, 1.25rem);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-main);
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    text-decoration: none;
    overflow: hidden; /* Mencegah konten luber */
}

.card-icon {
    font-size: clamp(1.3rem, 3.5vw, 1.5rem);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.link-text { 
    flex: 1; 
    font-weight: 500; 
    font-size: clamp(0.9rem, 2.5vw, 0.95rem);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Mengubah teks panjang menjadi "..." */
}

.external-icon {
    font-size: 1rem;
    color: var(--border-color);
    opacity: 0.4;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

/* HOVER EFFECT GLOW */
@media (hover: hover) {
    .link-card:hover {
        background-color: var(--bg-card-hover);
        border-color: var(--accent-color);
        transform: translateY(-3px);
        box-shadow: var(--accent-glow);
    }
    .link-card:hover .card-icon { color: var(--accent-color); text-shadow: var(--text-glow); }
    .link-card:hover .link-text { color: #fff; text-shadow: var(--text-glow); }
    .link-card:hover .external-icon { opacity: 1; transform: translateX(4px); color: var(--accent-color); }
}

/* =========================================
   6. FOOTER
   ========================================= */
.profile-footer {
    background-color: #0c0c0e;
    padding: clamp(1.2rem, 3vw, 1.8rem);
    text-align: center;
    border-top: 1px solid var(--border-color);
    font-family: var(--font-mono);
    font-size: clamp(0.75rem, 2vw, 0.8rem);
    color: var(--text-muted);
}
.copyright { margin-top: 0.6rem; opacity: 0.5; }

/* =========================================
   7. TOAST NOTIFICATION
   ========================================= */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: rgba(255, 255, 255, 0.95);
    color: #000;
    padding: 0.8rem 1.4rem;
    border-radius: 8px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    transform: translateY(120px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
}

.toast.show { transform: translateY(0); opacity: 1; border: 1px solid var(--accent-color); box-shadow: var(--accent-glow); }
.spinner { font-size: 1.2rem; animation: spin 1s linear infinite; color: var(--accent-color); }
@keyframes spin { 100% { transform: rotate(360deg); } }

/* =========================================
   8. MEDIA QUERIES STRICT (MOBILE FIRST TWEAKS)
   ========================================= */

/* Untuk layar HP standar/kecil (iPhone SE, Android biasa) */
@media (max-width: 600px) {
    .link-grid {
        grid-template-columns: 1fr; /* Memaksa selalu 1 baris ke bawah di HP */
    }
    .toast {
        left: 50%;
        right: auto;
        transform: translate(-50%, 120px); /* Pindah posisi toast ke tengah di HP */
        width: max-content;
        max-width: 90vw;
    }
    .toast.show { transform: translate(-50%, 0); }
}

/* Untuk Layar sangat kecil (Galaxy Fold / Layar di bawah 360px) */
@media (max-width: 360px) {
    .window-title { display: none; } /* Sembunyikan judul terminal agar tombol titik tidak terhimpit */
    .link-card { padding: 0.9rem; }
}
