/* ==========================================================================
   CSS Variables & Theming (Fadhil Gani Reference Clone)
   ========================================================================== */
   :root {
    /* Light Theme (Default) */
    --bg-main: #ffffff;
    --text-main: #000000;
    --text-muted: #525252; /* neutral-600 */
    --border-color: #e5e5e5; /* neutral-200 */
    --dashed-grid: rgba(163, 163, 163, 0.2); /* neutral-400/20 */
    --pill-bg: #ffffff;
    --pill-border: #e5e5e5;
    --dot-color: #d4d4d8;
    --hover-bg: #f5f5f5;
}

.dark {
    /* Dark Theme */
    --bg-main: #0a0a0a; /* neutral-950 */
    --text-main: #ffffff;
    --text-muted: #a3a3a3; /* neutral-400 */
    --border-color: #262626; /* neutral-800 */
    --dashed-grid: rgba(64, 64, 64, 0.4); /* neutral-700/40 */
    --pill-bg: #171717; /* neutral-900 */
    --pill-border: #404040; /* neutral-700 */
    --dot-color: #525252; /* neutral-600 */
    --hover-bg: #171717;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-family: 'Inter', sans-serif;
}

body {
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.desktop-break {
    display: none;
}
@media (min-width: 1024px) {
    .desktop-break { display: block; }
}

/* ==========================================================================
   Background Grid (Dashed)
   ========================================================================== */
.bg-grid-wrapper {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
}

.bg-grid {
    position: absolute;
    inset: 0;
    background-image: 
        linear-gradient(to right, var(--dashed-grid) 1px, transparent 1px),
        linear-gradient(to bottom, var(--dashed-grid) 1px, transparent 1px);
    background-size: 64px 64px; /* Big squares */
    /* Make lines look dashed */
    mask-image: 
        linear-gradient(to bottom, black 50%, transparent 50%),
        linear-gradient(to right, black 50%, transparent 50%);
    mask-size: 8px 8px; /* Dashboard dash size */
    -webkit-mask-image: 
        linear-gradient(to bottom, black 50%, transparent 50%),
        linear-gradient(to right, black 50%, transparent 50%);
    -webkit-mask-size: 8px 8px;
    opacity: 0.8;
}

.bg-fade-top {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, var(--bg-main) 10%, transparent 50%, var(--bg-main) 90%);
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.header-placeholder {
    height: 4rem;
}
@media (min-width: 640px) {
    .header-placeholder { height: 5rem; }
}

.header {
    position: absolute;
    top: 0;
    width: 100%;
    height: 4rem;
    z-index: 50;
}
@media (min-width: 640px) {
    .header { height: 5rem; }
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 1rem;
    border-bottom: 1px solid transparent;
}
@media (min-width: 1024px) {
    .header-container {
        border-left: 1px solid var(--border-color);
        border-right: 1px solid var(--border-color);
        border-bottom: 1px solid var(--border-color);
        border-bottom-left-radius: 0.75rem;
        border-bottom-right-radius: 0.75rem;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
}

.logo-icon {
    font-size: 1.25rem;
    transform: translateY(-2px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.logo:hover .logo-icon {
    transform: translateY(-2px) rotate(-12deg) scale(1.2);
}

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.nav-links {
    display: none;
}
@media (min-width: 640px) {
    .nav-links {
        display: flex;
        align-items: center;
    }
}

.nav-link {
    text-decoration: none;
    color: inherit;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-main);
}

/* Theme Toggle */
.theme-toggle {
    display: flex;
    align-items: center;
    margin-left: 0.5rem;
    padding-left: 1rem;
    cursor: pointer;
    color: var(--text-main); /* Changed to use var(--text-main) for the dark text color like reference */
    font-weight: 500;
}
@media (min-width: 640px) {
    .theme-toggle { margin-left: 1rem; }
}

.theme-icon-wrapper {
    position: relative;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid transparent;
}
.theme-toggle:hover .theme-icon-wrapper {
    border-bottom-color: var(--text-muted);
}

.sun-icon, .moon-icon {
    position: absolute;
    width: 1.5rem;
    height: 1.5rem;
    transition: all 0.7s ease;
}

.dark .sun-icon { opacity: 0; visibility: hidden; }
.dark .moon-icon { opacity: 1; visibility: visible; }
.sun-icon { opacity: 1; visibility: visible; }
.moon-icon { opacity: 0; visibility: hidden; }

.theme-text {
    margin-left: 0.5rem;
    display: none;
}
@media (min-width: 640px) {
    .theme-text { display: inline-block; }
}

.dark .text-light { display: none; }
.dark .text-dark { display: inline; }
.text-light { display: inline; }
.text-dark { display: none; }


/* ==========================================================================
   Main Content Layout
   ========================================================================== */
main {
    max-width: 896px; /* max-w-4xl */
    margin: 0 auto;
    padding: 0 1.75rem;
    margin-top: 4rem;
}
@media (min-width: 768px) {
    main { margin-top: 6rem; }
}
@media (min-width: 1024px) {
    main { margin-top: 8rem; padding: 0; }
}

section {
    margin-bottom: 6rem;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-title {
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1.25rem;
}
@media (min-width: 768px) {
    .hero-title { font-size: 2.25rem; }
}
@media (min-width: 1024px) {
    .hero-title { font-size: 3.75rem; }
}

.hero-desc {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.animated-text {
    display: inline-block;
    min-width: 12ch;
    font-weight: 600;
    color: var(--text-main);
    border-right: 2px solid var(--text-main);
    animation: blink 1s step-end infinite;
}
@keyframes blink {
    50% { border-color: transparent; }
}

.tech-title {
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.tech-marquee-wrapper {
    overflow: hidden;
    position: relative;
    width: 100%;
    margin-top: 1.5rem;
    /* Fade edges for smooth enter/exit */
    mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black 10%, black 90%, transparent);
}

.tech-marquee {
    display: flex;
    width: max-content;
    animation: scroll-x 20s linear infinite;
}

.tech-marquee:hover {
    animation-play-state: paused;
}

@keyframes scroll-x {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.tech-pill {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background-color: var(--pill-bg);
    border: 1px solid var(--pill-border);
    border-radius: 9999px;
    margin-right: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, background-color 0.2s ease;
}
.tech-pill:hover {
    background-color: var(--hover-bg);
    transform: translateY(-2px);
}

.tech-pill i {
    font-size: 1.25rem;
}

.pill-text {
    font-size: 0.875rem;
    color: var(--text-main);
}

.mt-8 {
    margin-top: 2rem;
}

.more-about-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    background-color: var(--text-main);
    color: var(--bg-main);
    border-radius: 9999px;
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.more-about-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* ==========================================================================
   Projects Section
   ========================================================================== */
.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
}

.view-all {
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.875rem;
    transition: color 0.2s;
}
.view-all:hover {
    color: var(--text-main);
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-item {
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    background-color: var(--pill-bg); /* subtle background */
}
.project-item:hover {
    background-color: var(--hover-bg);
    border-color: var(--text-muted);
}

.project-name {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
}

.project-tag {
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background-color: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem;
    color: var(--text-muted);
}

/* ==========================================================================
   About Section
   ========================================================================== */
.about-content {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.7;
}

.about-content p {
    margin-bottom: 1.25rem;
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 500;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}
.contact-link:hover {
    background-color: var(--hover-bg);
}

/* ==========================================================================
   Footer
   ========================================================================== */
.footer {
    border-top: 1px dashed var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-container {
    max-width: 896px;
    margin: 0 auto;
    padding: 0 1.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-muted);
    font-size: 0.875rem;
}
@media (min-width: 1024px) {
    .footer-container { padding: 0; }
}

/* ==========================================================================
   Animations
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}
