:root {
    --primary-color: #333;
    --secondary-color: #595959;
    --background-color: #fff;
    --accent-color: #000;
    --spacing-unit: 2rem;
    --border-color: #eaeaea;
    
    /* Typographic scale - 1.25 ratio (major third) */
    --text-xs: 0.8rem;    /* 12.8px */
    --text-sm: 0.9rem;    /* 14.4px */
    --text-base: 1rem;    /* 16px */
    --text-lg: 1.25rem;   /* 20px */
    --text-xl: 1.563rem;  /* 25px */
    --text-2xl: 1.953rem; /* 31.25px */
    --text-3xl: 2.441rem; /* 39px */
    --text-4xl: 3.052rem; /* 48.8px */
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
        "Segoe UI Symbol";
    line-height: 1.3;
    color: var(--primary-color);
    background-color: var(--background-color);
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    font-size: var(--text-base);
}

header {
    padding: var(--spacing-unit) 0;
    display: flex;
    justify-content: space-between;
    align-items: start;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: var(--spacing-unit);
}

header p{
    width: 40%;
    font-size: var(--text-sm);
    color: var(--secondary-color);
}

h1 {
    font-size: var(--text-4xl);
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

h2 {
    font-size: var(--text-3xl);
    font-weight: 600;
    margin: 2.5rem 0 1rem;
    padding-top: 1rem;
}

h3 {
    font-size: var(--text-2xl);
    font-weight: 600;
    margin: 0;
}

h3 span{
    color: var(--secondary-color);
}

p {
    margin-bottom: 0.5rem;
}

ul {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
}

a {
    color: var(--accent-color);
    text-decoration: underline;
}

a:hover {
    text-decoration: underline;
    opacity: 0.5;
}

.case-header {
    font-size: var(--text-lg);
    color: var(--secondary-color);
    margin-bottom: 2rem;
}

.portfolio-image {
    width: 100%;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inset {
    padding: 0 5%;
}

.logo {
    font-weight: 700;
    font-size: var(--text-lg);
}

.nav {
    font-size: var(--text-base);
}

/* Case studies grid layout */
.case-studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.case-study-card {
    border-radius: 8px;
    overflow: hidden;
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    border: 1px solid var(--border-color);
}

.case-study-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.case-study-card a {
    display: block;
    color: var(--primary-color);
    text-decoration: none;
}

.case-study-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.case-study-content {
    padding: 1.5rem;
}

.case-study-title {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.case-study-description {
    font-size: var(--text-sm);
    color: var(--secondary-color);
}

.case-study-meta {
    margin-top: 1rem;
    font-size: var(--text-xs);
    color: var(--secondary-color);
}

/* Portfolio */
.project {
    width: 100%;
    margin-bottom: 8rem;
}

.project p {
    max-width: 50%;
}

.project-images {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.project-images img {
    width: 100%;
    height: auto;
    object-fit: cover;
}

.project-details {
    display: grid;
    grid-template-columns: 3fr 1.5fr 0.5fr;
    column-gap: 0.5rem;
    row-gap: 0.5rem;
    align-items: start;
    margin-bottom: 2rem;
}

.project-details .description p {
    max-width: 100%;
    font-size: var(--text-sm);
}

.project-details .client {
    padding-left: 60px;
}

.project-details .year {
    text-align: right;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    header {
        display: block;
    }
    
    header p{
        width: 100%;
        margin-top: 1rem;
    }

    .case-studies-grid {
        grid-template-columns: 1fr;
    }

    .project-details {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "description description"
            "client year";
        gap: 1rem;
    }

    .project-details .description { grid-area: description; }
    .project-details .client { grid-area: client; padding:0; }
    .project-details .year { grid-area: year; }
}

/* Back to top */
.back-to-top {
    padding-bottom: 100px;
}

.back-to-top a {
    
}

.back-to-top a:hover {
    
}
