@import url('https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&family=Roboto+Condensed:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,100..900;1,100..900&display=swap');

/* ---------- CSS Variables for Dark/Light Mode ---------- */
:root {
  --bg-primary: #121212;
  --bg-secondary: #0f0f0f;
  --bg-tertiary: #1a1a1a;
  --text-primary: #ffffff;
  --text-secondary: #ddd;
  --text-tertiary: #aaa9a9;
  --border-color: #555555;
  --accent-color: #b2b2b2;
  --card-bg: #222;
  --header-bg: rgba(18, 18, 18, 0.5);
}

body.light-mode {
  --bg-primary: #f5f5f5;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f0f0f0;
  --text-primary: #1a1a1a;
  --text-secondary: #333333;
  --text-tertiary: #555555;
  --border-color: #cccccc;
  --accent-color: #333333;
  --card-bg: #e8e8e8;
  --header-bg: rgba(245, 245, 245, 0.7);
}

html {
    scroll-behavior: smooth;
}

:target {
    scroll-margin-top: 100px;
}

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

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 20px;
    transition: background-color 0.4s ease, color 0.4s ease;
}

/* ---------- Theme Toggle Button ---------- */
.theme-toggle {
    position: fixed;
    top: 25px;
    right: 25px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--header-bg);
    border: 2px solid var(--border-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1000;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
}

.theme-toggle:hover {
    transform: scale(1.1) rotate(20deg);
    border-color: var(--accent-color);
}

.theme-toggle svg {
    width: 24px;
    height: 24px;
    stroke: var(--text-primary);
    stroke-width: 2;
    transition: transform 0.4s ease;
}

.theme-toggle:hover svg {
    transform: rotate(180deg);
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

body.light-mode .sun-icon {
    display: block;
}

body.light-mode .moon-icon {
    display: none;
}

@media (max-width: 768px) {
    .theme-toggle {
        top: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }

    .theme-toggle svg {
        width: 20px;
        height: 20px;
    }
}

/* ---------- Header ---------- */
header {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    margin-left: 9%;
    margin-right: 9%;
    padding: 12px 20px;
    background: var(--header-bg);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(179, 178, 178, 0.1);
    border-radius: 20px;
    transition: all 0.4s ease;
    gap: 15px;
}

.header-title {
    font-family: "Inter", sans-serif;
    font-size: 24px;
    cursor: pointer;
    transition: 0.5s;
    color: var(--text-primary);
}

.header-title:hover {
    color: var(--accent-color);
}

/* ---------- Navbar ---------- */
nav {
    font-family: 'Roboto Condensed', sans-serif;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 25px;
}

.nav-links li {
    color: var(--text-tertiary);
    cursor: pointer;
    border: 1px solid rgba(179, 178, 178, 0.2);
    padding: 8px 20px;
    border-radius: 15px;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    background: rgba(51, 51, 51, 0.3);
}

.nav-links li:hover {
    color: var(--text-primary);
    background-color: var(--card-bg);
    border-color: var(--accent-color);
    transform: translateY(-3px);
}

.nav-links a {
    color: inherit;
    text-decoration: none;
}

/* ---------- About Section ---------- */
.about-section {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 70px;
    margin-left: 9%;
    margin-right: 9%;
    justify-content: center;
}

.profile-pic {
    border-radius: 50%;
    width: 90px;
    height: 90px;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.4s ease;
}

.profile-pic:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.about-section p {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 18px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 500px;
    margin: 0;
}

/* ---------- Background Image ---------- */
.bg-img img {
    display: block;
    margin: 50px auto;
    width: 85%;
    height: 300px;
    border-radius: 10px;
    object-fit: cover;
    object-position: center center;
    transition: all 0.4s ease;
}

.bg-img img:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* ---------- Info Section ---------- */
.info {
    font-family: 'Inter Tight', sans-serif;
    font-size: 70px;
    line-height: 1.2;
    margin-left: 9%;
    margin-bottom: 50px;
    text-align: center;
}

.info h2 {
    color: var(--text-primary);
    transition: color 0.4s ease;
}

.info p {
    display: inline;
    color: #494949;
}

body.light-mode .info p {
    color: #b0b0b0;
}

/* ---------- Location Section ---------- */
.location {
    display: flex;
    margin-left: 9%;
    margin-right: 5.5%;
    margin-top: 50px;
    flex-direction: row;
    color: var(--text-tertiary);
    font-size: 25px;
    font-family: "Roboto Condensed", sans-serif;
    justify-content: space-between;
}

.location p {
    padding: 10px 15px;
    background: rgba(51, 51, 51, 0.2);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.location p:hover {
    background: rgba(51, 51, 51, 0.5);
    border-color: var(--accent-color);
}

/* ---------- About Me Section ---------- */
.about-me {
    margin-left: 8.9%;
    margin-right: 5.5%;
    margin-bottom: 0;
}

.about-me p {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: 30px;
    color: var(--text-secondary);
    margin-top: 60px;
    margin-bottom: 0;
    transition: color 0.4s ease;
}

/* ---------- HR - Reduced Gap ---------- */
hr {
    border: 0.5px solid var(--border-color);
    width: 85.5%;
    margin-left: 8.9%;
    margin-right: auto;
    margin-bottom: clamp(15px, 2vw, 20px);
    margin-top: clamp(20px, 3vw, 25px);
}

/* ---------- History Section - Hero Style with Reduced Top Margin ---------- */
.history {
    margin-top: clamp(20px, 3vw, 40px);
    margin-left: 8.9%;
    margin-right: 5.5%;
    margin-bottom: clamp(40px, 8vw, 60px);
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.history h2 {
    font-family: 'Inter Tight', sans-serif;
    font-size: clamp(28px, 8vw, 70px);
    color: var(--text-primary);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -2px;
    margin-bottom: clamp(20px, 4vw, 30px);
    margin-top: 0;
    transition: color 0.4s ease;
}

.history h2 span {
    color: #888888;
    font-weight: 400;
}

body.light-mode .history h2 span {
    color: #999999;
}

.history a {
    color: inherit;
    text-decoration: none;
    display: block;
}

.history-description {
    font-family: 'Roboto Condensed', sans-serif;
    font-size: clamp(13px, 2.5vw, 16px);
    color: var(--text-tertiary);
    max-width: 600px;
    line-height: 1.8;
    margin-bottom: clamp(25px, 5vw, 40px);
    transition: color 0.4s ease;
}

.history-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: transparent;
    border: 2px solid var(--accent-color);
    color: var(--text-primary);
    padding: clamp(10px, 2vw, 14px) clamp(20px, 4vw, 30px);
    border-radius: 12px;
    font-size: clamp(13px, 2vw, 16px);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-weight: 600;
    font-family: 'Roboto Condensed', sans-serif;
}

.history-btn:hover {
    background: var(--accent-color);
    color: var(--bg-primary);
    transform: translateY(-4px);
    box-shadow: 0 15px 40px rgba(179, 178, 178, 0.3);
}

.history-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.history-btn:hover svg {
    transform: translateX(4px);
}

/* ---------- Projects Section ---------- */
.projects {
    margin-top: 50px;
    font-family: 'Roboto Condensed', sans-serif;
    margin-left: 8.9%;
}

.projects h2 {
    font-size: 30px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    transition: color 0.4s ease;
}

.project-item {
    background-color: var(--card-bg);
    border-radius: 10px;
    border: 1px solid rgba(179, 178, 178, 0.1);
    padding: 15px;
    box-sizing: border-box;
    padding-top: 30px;
    padding-bottom: 30px;
    margin-right: 20px;
    margin-bottom: 15px;
    transition: all 0.4s ease;
}

.project-item:hover {
    background-color: var(--card-bg);
    border: 1px solid var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.project-item h3 {
    color: var(--text-primary);
    margin-bottom: 10px;
}

.project-item p {
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.project-list {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    flex-direction: column;
    height: auto;
    font-size: larger;
    padding-bottom: 10px;
    letter-spacing: 0.5px;
    line-height: 40px;
    margin-top: 30px;
    margin-right: 5.5%;
}

.project-list button {
    background-color: #444;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.project-list button:hover {
    background-color: #555;
    transform: translateY(-2px);
}

body.light-mode .project-list button {
    background-color: #d0d0d0;
    color: #1a1a1a;
}

body.light-mode .project-list button:hover {
    background-color: #b0b0b0;
}

/* ---------- Skills Section ---------- */
.skillsh2 {
    font-size: 30px;
    font-family: 'Roboto Condensed', sans-serif;
    color: var(--text-secondary);
    margin-left: 8.9%;
    margin-right: 5.5%;
    margin-bottom: 40px;
    margin-top: 80px;
    transition: color 0.4s ease;
}

.skills-container {
    display: flex;
    gap: 40px;
    justify-content: space-between;
    margin-left: 8.9%;
    margin-right: 5.5%;
    flex-wrap: wrap;
}

.skills {
    flex: 1;
    min-width: 300px;
    font-family: 'Roboto Condensed', sans-serif;
    border: 1px solid rgba(179, 178, 178, 0.1);
    padding: 20px;
    padding-bottom: 60px;
    border-radius: 10px;
    background-color: var(--bg-tertiary);
    box-sizing: border-box;
    margin-bottom: 70px;
    transition: all 0.4s ease;
}

.skills p {
    font-size: 22px;
    text-align: center;
    margin-bottom: 15px;
    color: var(--text-secondary);
    transition: color 0.4s ease;
}

.skills hr {
    border: 0.5px solid var(--border-color);
    margin-top: 10px;
    margin-bottom: 20px;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.skill-list {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding-bottom: 10px;
    letter-spacing: 0.5px;
    line-height: 40px;
    margin-top: 30px;
    list-style: none;
    justify-content: center;
}

.skill-list li {
    background-color: #444;
    padding: 0px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    color: var(--text-primary);
}

body.light-mode .skill-list li {
    background-color: #d0d0d0;
    color: #1a1a1a;
}

.skill-list li:hover {
    background-color: #6c6c6c;
    transform: translateY(-2px);
}

body.light-mode .skill-list li:hover {
    background-color: #b0b0b0;
}

.skills:hover {
    background-color: var(--card-bg);
    border: 1px solid var(--accent-color);
    transform: translateY(-5px);
}

/* ---------- Goals Section ---------- */
.goals-section {
    display: flex;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
    margin-left: 8.9%;
    margin-right: 5.5%;
    margin-top: 90px;
    margin-bottom: 100px;
    font-family: 'Roboto Condensed', sans-serif;
}

.goal-card {
    background-color: var(--bg-tertiary);
    border: 1px solid rgba(179, 178, 178, 0.1);
    border-radius: 15px;
    padding: 25px 30px;
    color: var(--text-secondary);
    flex: 1 1 45%;
    min-width: 300px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.4s ease;
}

.goal-card:hover {
    background-color: var(--card-bg);
    border-color: var(--accent-color);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.goal-card h3 {
    color: var(--text-primary);
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 10px;
}

.goal-card hr {
    border: 0.5px solid var(--border-color);
    margin-bottom: 15px;
    margin-top: 5px;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.goal-card ul {
    list-style: none;
    padding-left: 0;
}

.goal-card li {
    margin-bottom: 10px;
    font-size: 17px;
    line-height: 1.6;
}

.goal-card p {
    font-size: 17px;
    line-height: 1.6;
}

/* ---------- Footer ---------- */
footer {
    background-color: var(--bg-secondary);
    color: var(--text-tertiary);
    padding: 40px 9%;
    text-align: center;
    border-top: 1px solid rgba(179, 178, 178, 0.1);
    font-family: 'Roboto Condensed', sans-serif;
    position: relative;
    transition: all 0.4s ease;
}

.footer-contact {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 35px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.footer-contact a {
    color: var(--text-tertiary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    padding: 8px 15px;
    border: 1px solid transparent;
    border-radius: 10px;
    transition: all 0.3s ease;
}

.footer-contact a:hover {
    color: var(--text-primary);
    border-color: var(--accent-color);
    background-color: var(--header-bg);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.footer-contact svg {
    transition: transform 0.3s ease, color 0.3s ease;
}

.footer-contact a:hover svg {
    transform: scale(1.2);
    color: var(--text-primary);
}

.footer-note {
    border-top: 1px solid rgba(179, 178, 178, 0.1);
    margin-top: 25px;
    padding-top: 10px;
    font-size: 14px;
    color: #888;
    letter-spacing: 0.5px;
}

footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color), transparent);
}

footer h2 {
    font-size: 24px;
    margin-bottom: 40px;
    color: var(--text-secondary);
    transition: color 0.4s ease;
}

/* ---------- Scroll Sections ---------- */
#projects, #skills, #about, #contact {
    scroll-margin-top: 100px;
}

.typewriter {
    display: inline-block;
    border-right: 2px solid var(--text-primary);
    padding-right: 5px;
    animation: blink 0.7s step-end infinite;
}

@keyframes blink {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--text-primary);
    }
}

/* ---------- Responsive Design ---------- */
@media (max-width: 1024px) {
    .info {
        font-size: 55px;
    }

    .bg-img img {
        width: 90%;
        height: 250px;
    }

    .about-section p {
        font-size: 16px;
        max-width: 400px;
    }
}

@media (max-width: 768px) {
    header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .nav-links {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        margin-top: 15px;
    }

    .nav-links li {
        padding: 10px 20px;
    }

    .about-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-pic {
        width: 80px;
        height: 80px;
    }

    .about-section p {
        font-size: 16px;
        max-width: 90%;
        margin-top: 15px;
    }

    .bg-img img {
        width: 95%;
        height: 220px;
    }

    .info {
        text-align: center;
        font-size: 42px;
        margin: 40px auto;
    }

    .location {
        flex-direction: column;
    }

    .about-me {
        margin-left: 0;
        margin-right: 0;
        padding: 0 15px;
    }

    .about-me p {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    hr {
        margin-bottom: clamp(12px, 2vw, 18px);
        margin-top: clamp(15px, 2vw, 20px);
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .history {
        margin-top: clamp(15px, 2vw, 30px);
        margin-left: 0;
        margin-right: 0;
        padding: 0 15px;
    }

    .goals-section {
        flex-direction: column;
    }

    .goal-card {
        width: 100%;
    }

    footer {
        padding: 30px 6%;
    }

    .footer-contact {
        gap: 20px;
    }

    .footer-contact a {
        font-size: 15px;
        padding: 6px 10px;
    }

    .footer-note {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .header-title {
        font-size: 20px;
    }

    .nav-links li {
        font-size: 14px;
        padding: 8px 15px;
    }

    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .info {
        font-size: 34px;
    }

    .about-me {
        padding: 0 10px;
    }

    .about-me p {
        margin-top: clamp(15px, 3vw, 25px);
    }

    hr {
        margin-bottom: clamp(10px, 1.5vw, 15px);
        margin-top: clamp(12px, 1.5vw, 18px);
    }

    .history {
        margin-top: clamp(10px, 1.5vw, 20px);
        padding: 0 10px;
    }
}