html {
    scroll-behavior: smooth;
}

/* Custom dynamic color-inspired palette */
:root {
    --md-sys-color-primary: #00AEEF;
    /* A vibrant blue */
    --md-sys-color-on-primary: #FFFFFF;
    --md-sys-color-surface: #1a1a1a;
    /* Dark gray for background, from your styles */
    --md-sys-color-on-surface: #f4f4f5;
    /* Soft off-white for text, from your styles */
    --md-sys-color-surface-container-high: #2a2a2a;
    /* Slightly lighter gray for cards, from your styles */
    --md-sys-color-on-surface-variant: #BDBDBD;
    --md-sys-color-accent: #60a5fa;
    /* Your accent color */
}

body {
    background-color: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    font-family: 'Inter', sans-serif;
}

.text-md-primary {
    color: var(--md-sys-color-primary);
}

.bg-md-surface {
    background-color: var(--md-sys-color-surface);
}

.text-md-on-surface {
    color: var(--md-sys-color-on-surface);
}

.bg-md-surface-container-high {
    background-color: var(--md-sys-color-surface-container-high);
}

.text-md-on-surface-variant {
    color: var(--md-sys-color-on-surface-variant);
}

/* Your custom CSS is moved here to be in one place */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: var(--md-sys-color-surface);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 1000;
}

nav ul {
    display: flex;
    justify-content: center;
    gap: 32px;
    list-style: none;
    padding: 16px;
}

nav a {
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    font-weight: 600;
    transition: color 0.3s;
}

nav a:hover {
    color: var(--md-sys-color-accent);
}

section {
    min-height: 100vh;
    padding: 80px 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("../assets/cosmic_clifs.jpg");
    background-position: center top;
    color: white;
    background-size: cover;
}

.hero a {
    background: var(--md-sys-color-accent);
    color: white;
    padding: 0.780px 1.80px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s, color 0.3s;
}

.transition1 {
    position: relative;
    height: 100px;
    background: linear-gradient(to bottom, transparent, var(--md-sys-color-surface));
    margin-top: -100px;
}

#about {
    background: var(--md-sys-color-surface);
}

.transition2 {
    position: relative;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #023335);
    margin-top: -100px;
}

#experience {
    background: #078d92;
    background-image: repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.05) 0px,
            rgba(255, 255, 255, 0.05) 2px,
            transparent 2px,
            transparent 40px);
}

.transition3 {
    position: relative;
    height: 100px;
    background: linear-gradient(to bottom, transparent, #16b913);
    margin-top: -100px;
}

#timeline {
    background: #16b913;
    background-image:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 2px, transparent 2px, transparent 40px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.05) 0px, rgba(255, 255, 255, 0.05) 2px, transparent 2px, transparent 40px);
}

#timeline h2 {
    color: rgb(0, 0, 0);
}

.transition4 {
    position: relative;
    height: 100px;
    background: linear-gradient(to bottom, transparent, rgb(226, 182, 6));
    margin-top: -100px;
}

#contact {
    background: rgb(226, 182, 6);
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.04) 0px,
        rgba(255, 255, 255, 0.04) 10px,
        transparent 4px,
        transparent 40px
    );
}

#contact h2 {
    color: black;
}


h3{
    font-size: 16px;
    font-weight: bold;
}

p {
    max-width: 700px;
    margin-bottom: 32px;
}

.hero h1 span {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.6s forwards;
}

.hero h1 span:nth-child(1) {
    animation-delay: 0s;
}

.hero h1 span:nth-child(2) {
    animation-delay: 0.2s;
}

.hero h1 span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1000px;
}

.card {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    padding: 32px;
    border-radius: 12px;
    transition: transform 0.3s, 0.3s, color 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    background: var(--md-sys-color-accent);
    color: var(--md-sys-color-on-primary);
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-link:hover .card {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

.timeline {
    position: relative;
    max-width: 700px;
    margin: 32px auto;
    padding-bottom: 32px;
}

.timeline::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--md-sys-color-accent);
    transform: translateX(-50%);
    z-index: 1;
}

.timeline-item {
    position: relative;
    margin-bottom: 32px;
    padding-left: 50%;
}

.timeline-item:nth-child(even) {
    padding-left: 0;
    padding-right: 50%;
    text-align: right;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    background-color: var(--md-sys-color-accent);
    border: 3px solid var(--md-sys-color-on-surface);
    top: 50%;
    border-radius: 50%;
    left: 50%;
    transform: translateY(-50%) translateX(-50%);
    z-index: 2;
}

.timeline-content {
    background: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    padding: 16px;
    border-radius: 8px;
    display: inline-block;
    max-width: 300px;
    position: relative;
    left: 16px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.timeline-item:nth-child(even) .timeline-content {
    left: -16px;
}

.timeline-content::before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px;
    border-color: transparent var(--md-sys-color-surface-container-high) transparent transparent;
    left: -20px;
    top: 50%;
    transform: translateY(-50%);
}

.timeline-item:nth-child(even) .timeline-content::before {
    border-color: transparent transparent transparent var(--md-sys-color-surface-container-high);
    right: -20px;
    left: auto;
}

.timeline-content:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}
.contact a {
    display: inline-block;
    margin: 8px;
    padding: 8px 16px;
    border: 2px solid var(--md-sys-color-on-surface);
    border-radius: 6px;
    text-decoration: none;
    color: var(--md-sys-color-on-surface);
    transition: 0.3s, color 0.3s;
}

.contact a:hover {
    background: var(--md-sys-color-on-surface);
    color: var(--md-sys-color-surface);
}

footer {
    padding: 32px;
    text-align: center;
    background: var(--md-sys-color-surface-container-high);
    margin-top: 32px;
}