@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&display=swap');

:root {
    --primary-color: #0f766e; /* Elegant teal */
    --secondary-color: #0d9488;
    --text-color: #1e293b; /* Slate 800 */
    --text-muted: #64748b; /* Slate 500 */
    --background-color: #ffffff;
    --border-color: #f1f5f9; /* Very soft slate 100 */
    --border-dark: #cbd5e1; /* Slate 300 */
    --box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.05), 0 2px 4px -2px rgb(0 0 0 / 0.05);
    --transition-speed: 0.2s;
    --container-width: 960px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    padding: 1.5rem 2rem;
    margin: 0 auto;
    max-width: var(--container-width);
    background-color: var(--background-color);
}

/* Typography */
h1, h2, h3 {
    font-family: 'Playfair Display', Georgia, serif;
    color: #0f172a; /* Slate 900 */
    margin-bottom: 0.5em;
    font-weight: 700;
}

h1 {
    font-size: clamp(2.2rem, 5vw, 3rem);
    line-height: 1.2;
}

h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.2rem);
    margin-top: 1.5em;
    padding-bottom: 0.3em;
    border-bottom: 1px solid var(--border-color);
}

h3 {
    font-size: clamp(1.25rem, 2.5vw, 1.6rem);
    color: var(--primary-color);
    margin-top: 1.2em;
}

p {
    font-size: 1.05rem;
    color: #334155; /* Slate 700 */
    margin-bottom: 1.2em;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color var(--transition-speed);
}

a:hover {
    color: var(--secondary-color);
}

/* Navigation - Emulating Andrew Ng's header */
.navmenu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: transparent;
    padding: 1.5rem 0;
    margin-bottom: 3rem;
    border-bottom: 1px solid var(--border-color);
    position: static;
    box-shadow: none;
}

.nav-brand {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.5rem;
    font-weight: 700;
}

.nav-brand a {
    color: var(--text-color);
    text-decoration: none;
}

.navlink {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.navlink a {
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0;
    border-bottom: 2px solid transparent;
    transition: color var(--transition-speed), border-color var(--transition-speed);
}

.navlink a:hover {
    color: var(--primary-color);
    background-color: transparent;
}

.navlink a.current {
    color: var(--text-color);
    font-weight: 600;
    background-color: transparent;
    border-bottom: 2px solid var(--primary-color);
}

/* About Layout (index.html) */
.about-container {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 4rem;
    margin-top: 2rem;
    align-items: start;
}

.about-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.profile-img-container {
    width: 100%;
    max-width: 280px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.profile-img-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgb(0 0 0 / 0.1), 0 8px 8px -6px rgb(0 0 0 / 0.1);
}

.profile-img-container img {
    width: 100%;
    height: auto;
    display: block;
}

.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem 0;
}

.sidebar-link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-muted);
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
    transition: all var(--transition-speed);
}

.sidebar-link-item:hover {
    color: var(--primary-color);
    background-color: #f1f5f9;
    border-color: var(--border-dark);
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-bio p {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.25rem;
    text-align: justify;
}

/* Writings / Lists Layout */
.writings-section {
    margin-top: 1rem;
}

.writing-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.writing-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 1.35rem;
    font-weight: 700;
}

.writing-title a {
    color: var(--text-color);
}

.writing-title a:hover {
    color: var(--primary-color);
}

.writing-meta {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.writing-desc {
    font-size: 1rem;
    color: #475569;
    margin-top: 0.5rem;
    margin-bottom: 0;
    line-height: 1.5;
}

/* Contact Page Styles */
.contact-container {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    border-radius: 12px;
    background-color: #f8fafc;
    border: 1px solid var(--border-color);
}

.contact-info-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 1.5rem 1rem;
    align-items: center;
    margin-top: 2rem;
}

.contact-label {
    font-weight: 600;
    color: var(--text-color);
}

/* Form elements (Preserved & Enhanced) */
input[type="number"],
input[type="text"],
select {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    padding: 0.6em 0.8em;
    width: 100%;
    max-width: 400px;
    min-width: 140px;
    border: 1px solid var(--border-dark);
    border-radius: 6px;
    margin: 0.2em 0 0.8em;
    background-color: #ffffff;
    color: var(--text-color);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

input[type="range"] {
    width: 100%;
    max-width: 400px;
    margin: 0.5rem 0 1rem;
    accent-color: var(--primary-color);
}

select {
    width: 7em;
    max-width: 7em;
    min-width: 7em;
}

label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5em;
}

/* Page Components */
.chart-container {
    width: 100%;
    max-width: 1000px;
    margin: 2rem auto;
    height: clamp(300px, 50vh, 400px);
}

.svg-container {
    width: 100%;
    max-width: 900px;
    margin: 2rem auto;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
}

.svg-container img,
.svg-container svg {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
}

.info-box {
    background-color: #f8fafc;
    border-left: 4px solid var(--primary-color);
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.info-box .info-icon {
    font-size: 1.25rem;
    color: var(--primary-color);
}

ul {
    font-size: 1rem;
    line-height: 1.6;
    margin: 1rem 0;
    padding-left: 2rem;
}

ul li {
    margin-bottom: 0.5rem;
}

.agenda-section {
    background-color: #f8fafc;
    border-left: 4px solid var(--primary-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    border-top: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.table-container {
    width: 100%;
    overflow-x: auto;
    margin: 2rem 0;
}

.measurement-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    text-align: left;
}

.measurement-table th,
.measurement-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.measurement-table th {
    background-color: #f8fafc;
    font-weight: 600;
}

.contact-button {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background-color: var(--primary-color);
    color: #ffffff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: background-color var(--transition-speed);
}

.contact-button:hover {
    background-color: var(--secondary-color);
    color: #ffffff;
}

footer {
    text-align: center;
    margin-top: 5rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .navmenu {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 2rem;
    }

    .navlink {
        gap: 1.25rem;
    }

    .about-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-sidebar {
        width: 100%;
    }

    .about-bio p {
        text-align: left;
    }
}