@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;1,9..40,400&family=JetBrains+Mono:wght@400;500&display=swap');

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

:root {
    --bg: #f8f9fa;
    --surface: #ffffff;
    --ink: #18181b;
    --muted: #71717a;
    --rule: #e4e4e7;
    --rule-strong: #d4d4d8;
    --accent: #18181b;
    --accent-hover: #52525b;
    --max-width: 96vw;
    --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

    /* Fluid scale — grows with viewport */
    --nav-height: clamp(3.25rem, 5vw, 5rem);
    --space-xs: clamp(0.25rem, 0.5vw, 0.5rem);
    --space-sm: clamp(0.5rem, 1vw, 0.85rem);
    --space-md: clamp(0.85rem, 1.5vw, 1.25rem);
    --space-lg: clamp(1.25rem, 2.5vw, 2rem);
    --space-xl: clamp(2rem, 4vw, 3.5rem);
    --radius-sm: clamp(0.35rem, 0.6vw, 0.5rem);
    --radius-md: clamp(0.5rem, 1vw, 0.75rem);
    --radius-lg: clamp(0.65rem, 1.2vw, 1rem);
}

html {
    /* Root scale: all rem units follow viewport size */
    font-size: clamp(15px, 0.45rem + 0.85vw, 22px);
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--ink);
    line-height: 1.7;
    min-height: 100vh;
    font-size: 1rem;
}

/* Top navigation */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: blur(clamp(8px, 1.5vw, 14px));
    -webkit-backdrop-filter: blur(clamp(8px, 1.5vw, 14px));
    border-bottom: 1px solid var(--rule);
    padding: 0 clamp(1rem, 3vw, 2.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    animation: navDrop 0.55s var(--ease-out) both;
}

.site-name {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.15rem, 1.6vw, 1.55rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1;
    display: flex;
    align-items: center;
    height: 100%;
}

.site-name a {
    color: var(--ink);
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.site-name a:hover {
    opacity: 0.65;
}

nav ul {
    list-style: none;
    display: flex;
    align-items: center;
    height: 100%;
    gap: var(--space-xs);
    margin: 0;
}

nav ul li {
    display: flex;
    align-items: center;
    height: 100%;
}

nav ul li a {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    font-size: clamp(0.8rem, 1vw, 1rem);
    font-weight: 500;
    color: var(--muted);
    text-decoration: none;
    padding: 0 clamp(0.5rem, 1.2vw, 0.85rem);
    border-radius: var(--radius-sm);
    transition: color 0.25s ease, background-color 0.25s ease;
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0.1em;
    left: 50%;
    width: 0;
    height: clamp(1px, 0.15vw, 2px);
    background: var(--ink);
    border-radius: 1px;
    transition: width 0.3s var(--ease-out), left 0.3s var(--ease-out);
}

nav ul li a:hover {
    color: var(--ink);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: calc(100% - 1.2em);
    left: 0.6em;
}

nav ul li a.active {
    color: var(--ink);
}

@keyframes navDrop {
    from {
        opacity: 0;
        transform: translateY(-100%);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main content */
.content {
    width: var(--max-width);
    max-width: var(--max-width);
    margin: 0 auto;
    padding: calc(var(--nav-height) + var(--space-xl)) clamp(1rem, 3vw, 2.5rem) var(--space-xl);
    animation: fadeUp 0.65s var(--ease-out) 0.12s both;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(clamp(12px, 2vw, 18px));
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

section {
    margin-bottom: var(--space-xl);
}

section[id] {
    scroll-margin-top: calc(var(--nav-height) + var(--space-md));
}

/* Home hero */
.home-section {
    padding: var(--space-md) 0 var(--space-xl);
    margin-bottom: var(--space-md);
    text-align: center;
}

.hero-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1rem, 2.5vw, 1.75rem);
    animation: fadeUp 0.7s var(--ease-out) 0.2s both;
}

.home-section img {
    width: clamp(5.5rem, 12vw, 9rem);
    height: clamp(5.5rem, 12vw, 9rem);
    object-fit: cover;
    border-radius: 50%;
    flex-shrink: 0;
    border: clamp(1px, 0.2vw, 2px) solid var(--rule);
    transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}

.home-section img:hover {
    transform: scale(1.04);
    box-shadow: 0 clamp(4px, 1vw, 8px) clamp(16px, 3vw, 30px) rgba(0, 0, 0, 0.08);
}

.hero-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.home-section h1 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.85rem, 4vw + 0.5rem, 3.25rem);
    font-weight: 600;
    letter-spacing: -0.03em;
    line-height: 1.1;
    color: var(--ink);
}

.home-section p.subtitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.65rem, 0.8vw, 0.85rem);
    color: var(--muted);
    margin-top: var(--space-sm);
    letter-spacing: 0.04em;
}

.social-buttons {
    margin-top: var(--space-md);
    display: flex;
    justify-content: center;
    gap: clamp(0.65rem, 1.5vw, 1.25rem);
}

.social-buttons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: clamp(2.75rem, 5vw, 4.5rem);
    height: clamp(2.75rem, 5vw, 4.5rem);
    border: none;
    background: none;
    transition: transform 0.25s var(--ease-out), opacity 0.25s ease;
}

.social-buttons a:hover {
    transform: translateY(clamp(-1px, -0.2vw, -2px));
    opacity: 0.8;
    text-decoration: none;
}

.social-buttons img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Page sections */
.page-section {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: var(--radius-lg);
    padding: clamp(1.5rem, 3vw, 2.75rem) clamp(1.25rem, 3.5vw, 3rem);
    transition: box-shadow 0.35s ease;
}

.page-section:hover {
    box-shadow: 0 clamp(2px, 0.5vw, 4px) clamp(12px, 2.5vw, 24px) rgba(0, 0, 0, 0.04);
}

.page-section h2 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.75rem, 2.5vw + 0.75rem, 2.35rem);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-sm);
    border-bottom: 1px solid var(--rule);
}

.page-section h3 {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.15rem, 1.4vw + 0.45rem, 1.5rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    text-transform: none;
    color: var(--ink);
    margin: var(--space-xl) 0 var(--space-md);
}

.page-section h3:first-of-type {
    margin-top: 0;
}

.page-section p {
    margin-bottom: var(--space-md);
    color: #3f3f46;
    font-size: clamp(0.88rem, 0.85vw + 0.2rem, 0.98rem);
}

.intro-contact {
    margin-bottom: var(--space-md);
}

.page-section p:last-child {
    margin-bottom: 0;
}

/* Entry blocks */
.entry-card {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--rule);
    animation: fadeUp 0.5s var(--ease-out) both;
}

.entry-card:nth-child(1) { animation-delay: 0.08s; }
.entry-card:nth-child(2) { animation-delay: 0.16s; }
.entry-card:nth-child(3) { animation-delay: 0.24s; }
.entry-card:nth-child(4) { animation-delay: 0.32s; }

.entry-card:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--space-md);
    margin-bottom: 0.1em;
}

.entry-header:has(.entry-title) {
    margin-bottom: var(--space-sm);
}

.entry-title {
    flex: 1;
    min-width: 0;
}

.entry-title h4 {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: clamp(0.95rem, 0.9vw + 0.35rem, 1.05rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.05em;
    color: var(--ink);
}

.entry-title .entry-gpa {
    margin: 0;
    line-height: 1.4;
}

.entry-header h4 {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: clamp(0.95rem, 0.9vw + 0.35rem, 1.05rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0;
    color: var(--ink);
    flex: 1;
    min-width: 0;
}

.entry-card h4 {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: clamp(0.95rem, 0.9vw + 0.35rem, 1.05rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 0.2em;
    color: var(--ink);
}

.entry-card .entry-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.72rem, 0.75vw, 0.82rem);
    color: var(--muted);
    letter-spacing: 0.02em;
    margin-bottom: 0;
    flex-shrink: 0;
    text-align: right;
    white-space: nowrap;
}

.entry-header + .entry-degree,
.entry-header + .entry-org {
    margin-top: 0;
}

.entry-card p {
    margin-top: 0;
    margin-bottom: 0.2em;
}

.entry-card p:last-child {
    margin-bottom: 0;
}

.entry-card .entry-degree {
    font-size: clamp(0.88rem, 0.85vw + 0.2rem, 0.98rem);
    color: #3f3f46;
    margin-bottom: 0.25em;
    line-height: 1.5;
}

.entry-card .entry-gpa {
    font-size: clamp(0.85rem, 0.8vw + 0.15rem, 0.92rem);
    color: var(--muted);
    margin: 0;
}

.entry-card .entry-meta {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.72rem, 0.75vw, 0.82rem);
    color: var(--muted);
    letter-spacing: 0.02em;
    margin-bottom: var(--space-sm);
    line-height: 1.6;
}

.entry-card .entry-org {
    font-size: clamp(0.88rem, 0.85vw + 0.2rem, 0.98rem);
    color: var(--muted);
    margin-bottom: var(--space-sm);
}

.entry-card ul {
    margin-left: 1.2em;
    margin-bottom: 0;
}

.entry-card li {
    margin-bottom: 0.3em;
    color: #3f3f46;
    font-size: clamp(0.88rem, 0.85vw + 0.2rem, 0.98rem);
}

.entry-links {
    margin-top: 0;
    margin-bottom: var(--space-sm);
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
}

.entry-links a {
    margin-right: var(--space-md);
}

/* Project entries with image on the right */
.project-entry {
    display: flex;
    align-items: center;
    gap: clamp(1.25rem, 3vw, 2.5rem);
}

.project-content {
    flex: 1 1 48%;
    min-width: 0;
}

.project-image {
    flex: 1 1 48%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.project-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--rule);
}

/* Skills */
.skill-group {
    margin-bottom: var(--space-md);
    animation: fadeUp 0.5s var(--ease-out) both;
}

.skill-group:nth-child(1) { animation-delay: 0.1s; }
.skill-group:nth-child(2) { animation-delay: 0.18s; }
.skill-group:nth-child(3) { animation-delay: 0.26s; }

.skill-group:last-child {
    margin-bottom: 0;
}

.skill-group h4 {
    font-family: 'DM Sans', system-ui, sans-serif;
    font-size: clamp(0.88rem, 0.85vw + 0.2rem, 0.98rem);
    font-weight: 600;
    letter-spacing: 0;
    text-transform: none;
    color: var(--ink);
    margin-bottom: 0.3em;
}

.skill-tags {
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: clamp(0.85rem, 0.8vw + 0.15rem, 0.92rem);
    line-height: 1.7;
    color: #3f3f46;
}

.skill-tags li {
    display: inline;
    margin: 0;
}

.skill-tags li:not(:last-child)::after {
    content: ' · ';
    color: var(--rule-strong);
}

.tutoring-details {
    width: 100%;
    max-width: none;
}

.tutoring-details h3 {
    margin-top: 0;
}

/* Tutoring highlight */
.highlight-box {
    background: var(--bg);
    border: 1px solid var(--rule);
    border-radius: var(--radius-md);
    padding: clamp(1rem, 2vw, 1.5rem) clamp(1.1rem, 2.5vw, 1.75rem);
    margin: var(--space-lg) 0;
    animation: fadeUp 0.5s var(--ease-out) 0.15s both;
}

.highlight-box.tutoring-details {
    margin: var(--space-md) 0 var(--space-lg);
}

.highlight-box h3 {
    margin-top: 0;
}

.highlight-box ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.highlight-box li {
    margin-bottom: 0.25em;
    color: #3f3f46;
}

.highlight-box .rate {
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.2rem, 2vw + 0.5rem, 1.75rem);
    font-weight: 600;
    color: var(--ink);
    margin: 0.35em 0 0.5em;
}

.highlight-box .rate-note {
    font-size: 0.7em;
    white-space: nowrap;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr));
    gap: clamp(0.85rem, 1.5vw, 1.25rem);
    margin: var(--space-md) 0 var(--space-lg);
}

.pricing-note {
    margin-bottom: var(--space-sm);
}

.pricing-policy {
    margin: var(--space-md) 0 var(--space-lg);
}

.pricing-policy h3 {
    margin-top: 0;
    margin-bottom: var(--space-sm);
}

.pricing-policy p {
    margin-bottom: var(--space-sm);
    color: #3f3f46;
    font-size: clamp(0.88rem, 0.85vw + 0.2rem, 0.98rem);
}

.pricing-policy p:last-child {
    margin-bottom: 0;
}

#pst-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.92em;
}

.pricing-card {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.pricing-card h4 {
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.6rem, 0.7vw, 0.75rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin: 0 0 0.25em;
}

.pricing-card p:last-child {
    margin-bottom: 0;
    flex-grow: 1;
}

.tutor-location {
    margin-top: var(--space-md);
    padding-top: var(--space-md);
    border-top: 1px solid var(--rule);
}

.location-summary {
    margin-bottom: var(--space-xs);
    color: #3f3f46;
}

.location-map-links {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
    margin-bottom: var(--space-sm);
    font-size: clamp(0.88rem, 0.85vw + 0.2rem, 0.98rem);
}

.location-map-links a {
    width: fit-content;
}

.location-map {
    height: clamp(14rem, 42vw, 22rem);
    border-radius: var(--radius-md);
    border: 1px solid var(--rule);
    overflow: hidden;
    background: var(--surface);
}

.location-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* Contact */
.contact-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(0.85rem, 1.5vw, 1.25rem);
    margin-top: var(--space-lg);
}

.contact-item {
    padding: 0;
}

.contact-item strong {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: clamp(0.6rem, 0.7vw, 0.75rem);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 0.25em;
}

.contact-item a {
    font-size: clamp(0.9rem, 1vw, 1.05rem);
}

/* CTA */
.cta-section {
    margin-top: var(--space-lg);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--rule);
}

/* Lists */
ul, ol {
    margin-left: 1.2em;
    margin-bottom: var(--space-md);
}

li {
    margin-bottom: 0.25em;
    color: #3f3f46;
}

/* Links */
a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

a:hover {
    color: var(--accent-hover);
    border-bottom-color: var(--rule-strong);
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Layout-only breakpoint — sizing handled by fluid scale above */
@media (max-width: 720px) {
    nav {
        height: auto;
        min-height: var(--nav-height);
        flex-wrap: wrap;
        gap: var(--space-sm);
        padding-top: var(--space-sm);
        padding-bottom: var(--space-sm);
    }

    .site-name,
    nav ul,
    nav ul li,
    nav ul li a {
        height: auto;
    }

    nav ul {
        flex-wrap: wrap;
        width: 100%;
    }

    nav ul li a::after {
        display: none;
    }

    nav ul li a.active {
        background: var(--bg);
    }

    .entry-header {
        flex-wrap: wrap;
    }

    .entry-header .entry-date {
        text-align: left;
        white-space: normal;
    }

    .project-entry {
        flex-direction: column;
        align-items: stretch;
    }

    .project-content {
        flex: none;
        max-width: none;
    }

    .project-image {
        flex: none;
        width: 100%;
        max-width: none;
    }
}
