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

body {
    background-color: #353535;
    background-image: url("texture-gray.png");
    background-size: cover;
    background-attachment: fixed;
    color: #ffffff;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
}

.header,
main {
    position: relative;
    z-index: 1;
}

.header {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 30px 53px 0;
    width: 100%;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 16px;
    color: #ffffff;
    text-decoration: none;
    font-size: 20px;
    line-height: 1.48;
    letter-spacing: -0.019em;
    transition: opacity 0.2s ease;
}

.contact-link:hover,
.contact-link:focus-visible {
    opacity: 0.7;
}

.contact-link img {
    width: 43px;
    margin-right: -16px;
    height: auto;
    display: block;
}

.hero {
    padding: 174px 4% 0;
}

.greeting {
    font-size: clamp(42px, 7vw, 88px);
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: 0.025em;
}

.bio {
    max-width: 837px;
    margin-top: 21px;
    font-size: 20px;
    line-height: 1.48;
    letter-spacing: -0.019em;
}

.decoration {
    width: 100%;
    margin: 80px 0 148px;
    overflow: hidden;
}

.decoration img {
    width: 100%;
    height: auto;
    display: block;
    animation: draw-line 3.5s ease-in-out 0.3s both;
}

@keyframes draw-line {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
}

@media (prefers-reduced-motion: reduce) {
    .decoration img {
        animation: none;
    }
}

.ux-work {
    padding: 0 4%;
}

.section-title {
    font-size: clamp(28px, 3.7vw, 48px);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.work-grid {
    display: flex;
    flex-direction: column;
    gap: clamp(48px, 10vw, 76px);
    width: 100%;
    margin-top: 28px;
    padding-bottom: 76px;
}

.work-card {
    width: 100%;
    aspect-ratio: 1.94;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    container-type: inline-size;
}

.work-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top;
    display: block;
    border-radius: inherit;
    transition: opacity 0.3s ease;
}

.work-overlay {
    position: absolute;
    inset: 0;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.work-card:hover .work-overlay {
    opacity: 1;
}

.work-card:hover .work-cover {
    opacity: 0;
}

.work-logo {
    width: 34%;
    height: auto;
}

.work-logo[src*="hubspot"] {
    width: 36.3%;
}

.work-logo[src*="imprivata"] {
    width: 35%;
}

.work-logo[src*="hubspot"] + .work-name {
    margin-top: 1.8cqw;
}

.work-logo[src*="broad"] + .work-name {
    margin-top: 3.16cqw;
}

.work-logo[src*="imprivata"] + .work-name {
    margin-top: 3.38cqw;
}

.work-name {
    font-family: 'Inter', sans-serif;
    font-size: max(3cqw, 14px);
    line-height: 1.48;
    font-weight: 400;
    color: #383838;
    margin-top: 0;
    letter-spacing: -0.019em;
    text-align: center;
}

@media (max-width: 600px) {
    .header {
        padding: 20px 5% 0;
    }

    .hero {
        padding: 100px 5% 0;
    }

    .greeting {
        font-size: clamp(36px, 10vw, 56px);
        letter-spacing: 0.015em;
    }

    .bio {
        max-width: 100%;
        font-size: 18px;
    }

    .decoration {
        margin: 48px 0 74px;
    }

    .ux-work {
        padding: 0 5%;
    }

    .work-grid {
        gap: 36px;
        margin-top: 24px;
        padding-bottom: 52px;
    }
}

/* ---- Modal Backdrop ---- */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: #353535;
    background-image: url("texture-gray.png");
    background-size: cover;
    background-attachment: fixed;
    z-index: 1000;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
    padding: 160px 57px 78px;
}

.modal-contact {
    position: absolute;
    top: 30px;
    right: 53px;
    gap: 16px;
    font-size: 20px;
    line-height: 1.48;
    letter-spacing: -0.019em;
}

.modal-backdrop.visible {
    opacity: 1;
    visibility: visible;
}

/* ---- Modal Panel ---- */
.modal-panel {
    width: 100%;
    max-width: 1326px;
    margin: 0 auto;
    background-color: #ffffff;
    color: #383838;
    border-radius: 20px;
    padding: 94px 100px 89px;
    transform: translateY(30px);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    position: relative;
}

.modal-panel.open {
    transform: translateY(0);
    opacity: 1;
}

/* ---- Close Button ---- */
.modal-close {
    position: absolute;
    top: 65px;
    right: 53px;
    width: 43px;
    height: 43px;
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.modal-close::before,
.modal-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 3.2px;
    margin-top: -1.6px;
    border-radius: 10px;
    background: currentColor;
    transform: rotate(45deg);
}

.modal-close::after {
    transform: rotate(-45deg);
}

.modal-close:hover {
    opacity: 1;
}

/* ---- Modal Body ---- */
.modal-body {
    max-width: 1326px;
    margin: 0 auto;
}

/* ---- Case Study Header ---- */
.cs-title {
    font-size: clamp(48px, 6.5vw, 100px);
    font-weight: 300;
    letter-spacing: -0.019em;
    line-height: 1.48;
    margin-bottom: 10px;
    color: #000;
}

.cs-meta {
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -0.019em;
    margin-bottom: 57px;
    color: #000;
}

.cs-meta strong {
    font-weight: 500;
    color: #000;
}

/* ---- Prototype walkthrough video ---- */
.cs-video {
    display: block;
    width: 100%;
    height: auto;
    background-color: #d9d9d9;
    border-radius: 20px;
    margin-bottom: 41px;
}

/* ---- Sections ---- */
.cs-section {
    margin-bottom: 70px;
}

/* Text blocks sit in a column indented from the full-width media */
.cs-section-title,
.cs-section > .cs-body,
.cs-problems {
    margin-left: 167px;
    margin-right: 167px;
}

.cs-section-title {
    font-size: clamp(28px, 3.2vw, 40px);
    font-weight: 400;
    letter-spacing: -0.022em;
    line-height: 1.5;
    margin-bottom: 15px;
    color: #000;
}

.cs-section-title.medium {
    font-weight: 500;
}

.cs-subsection-title {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: -0.019em;
    line-height: 1.5;
    margin-bottom: 19px;
    color: #000;
}

.cs-body {
    font-size: 18px;
    line-height: 1.5;
    letter-spacing: -0.019em;
    max-width: 792px;
    margin-bottom: 35px;
    color: #000;
}

.cs-section > .cs-body:last-child {
    margin-bottom: 0;
}

/* Hand-drawn illustrations beside the Usability testing text */
.cs-usability {
    position: relative;
}

.cs-doodle {
    position: absolute;
    display: block;
}

.cs-doodle-left {
    left: 75px;
    top: 215px;
    width: 74px;
}

.cs-doodle-right {
    left: 987px;
    top: 334px;
    width: 68px;
}

.cs-body strong {
    font-weight: 500;
}

.cs-body.thoughts-body {
    font-weight: 500;
    color: #1e1e1e;
}

/* ---- Problems ---- */
.cs-problems {
    display: flex;
    flex-direction: column;
    gap: 36px;
    margin-bottom: 28px;
}

.cs-section-title + .cs-problems {
    margin-top: 28px;
}

.cs-problem-item {
    display: flex;
    gap: 35px;
    align-items: center;
}

.cs-problem-icon {
    flex-shrink: 0;
    width: 78px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-problem-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.cs-problem-item p {
    font-size: 18px;
    line-height: 1.5;
    letter-spacing: -0.019em;
    max-width: 462px;
    color: #000;
}

/* ---- Goals & Constraints Cards ---- */
.cs-goals-constraints {
    display: flex;
    gap: 100px;
}

.cs-card {
    flex: 1;
    padding: 53px 35px 54px;
    border-radius: 20px;
    border: 2px solid;
}

.cs-card.goals {
    background-color: #effff0;
    border-color: #15911f;
}

.cs-card.constraints {
    background-color: #fff9ec;
    border-color: #bea469;
}

.cs-card h3 {
    font-size: clamp(28px, 3.2vw, 40px);
    font-weight: 500;
    letter-spacing: -0.022em;
    line-height: 1.5;
    margin-bottom: 24px;
    color: #000;
    text-align: center;
}

.cs-card ul {
    list-style: disc outside;
    padding-left: 0;
}

.cs-card li {
    font-size: 18px;
    line-height: 1.8;
    letter-spacing: -0.019em;
    margin-bottom: 7px;
    color: #000;
}

/* ---- Design Comparisons ---- */
.cs-design-comparison {
    display: grid;
    grid-template-columns: minmax(0, 336px) 45px minmax(0, 1fr);
    column-gap: 28px;
    align-items: center;
    margin-bottom: 60px;
}

.cs-design-before {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.cs-design-after {
    display: contents;
}

.cs-comparison-arrow {
    grid-column: 2;
    grid-row: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cs-comparison-arrow svg {
    width: 45px;
    height: auto;
    display: block;
}

.cs-design-before img,
.cs-design-after img {
    width: 100%;
    height: auto;
    border: 1px solid #000;
    display: block;
}

.cs-design-before img {
    border-radius: 5px;
    margin-bottom: 12px;
}

.cs-design-after img {
    grid-column: 3;
    grid-row: 1;
    border-radius: 20px;
}

.cs-design-after .cs-caption {
    grid-column: 3;
    grid-row: 2;
    margin-top: 18px;
}

.cs-caption {
    font-size: 14px;
    line-height: 1.5;
    color: #000;
    letter-spacing: -0.019em;
    max-width: 100%;
}

.cs-improvement-block {
    margin-top: 64px;
}

.cs-improvement-block .cs-caption {
    font-weight: 600;
}

/* ---- Terra workflows case study ---- */
.cs-section > .cs-figure,
.cs-section > .cs-callout {
    margin-left: 167px;
    margin-right: 167px;
}

.cs-hero {
    display: block;
    width: 100%;
    max-width: 986px;
    height: auto;
    margin: 0 auto 41px;
}

.cs-card p {
    font-size: 18px;
    line-height: 1.8;
    letter-spacing: -0.019em;
    margin-bottom: 7px;
    color: #000;
}

.cs-list {
    padding-left: 0;
    list-style: disc outside;
}

.cs-list li {
    margin-bottom: 18px;
    margin-left: 27px;
}

.cs-list li:last-child {
    margin-bottom: 0;
}

.cs-lead {
    margin-bottom: 16px;
}

.cs-figure img {
    display: block;
    width: 100%;
    height: auto;
}

.cs-caption-right {
    text-align: right;
    margin-top: 8px;
}

.cs-diagram,
.cs-section > .cs-diagram {
    margin-bottom: 48px;
}

.cs-section > figure.cs-figure {
    margin-top: 0;
    margin-bottom: 0;
}

.cs-callout {
    display: flex;
    gap: 31px;
    align-items: flex-start;
    max-width: 793px;
    padding: 32px 34px;
    border: 1px solid #02a0c2;
    border-radius: 10px;
    font-size: 16px;
    line-height: 1.5;
    letter-spacing: -0.019em;
    color: #000;
}

.cs-callout p + p {
    margin-top: 20px;
}

.cs-callout-mark {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background-color: rgba(72, 222, 255, 0.2);
}

.cs-after-callout {
    margin-top: 40px;
}

.cs-wide-figure {
    margin: 40px 0 0;
}

.cs-workshop {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #000;
    border-radius: 20px;
    margin-bottom: 12px;
}

.cs-wide-image {
    display: block;
    width: 100%;
    height: auto;
    margin-top: 40px;
}

.cs-bordered {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid #000;
    border-radius: 20px;
}

.cs-wide-figure .cs-bordered {
    margin-bottom: 12px;
}

.cs-cover-phones {
    display: block;
    width: 74%;
    height: auto;
    margin: 0 auto 41px;
}

.cs-after-figure {
    margin-top: 40px;
}

.cs-experience img {
    display: block;
    width: 100%;
    height: auto;
}

.cs-experience-captions {
    display: flex;
    margin-top: 12px;
}

.cs-experience-captions .cs-caption {
    width: 26.6%;
}

.cs-experience-captions .cs-caption:first-child {
    margin-left: 27.2%;
}

.cs-experience-captions .cs-caption:last-child {
    margin-left: 0;
    width: 30%;
}

/* Terra screenshots are exported with their 1px black border and rounded corners already applied */
.cs-baked .cs-design-before img,
.cs-baked .cs-design-after img {
    border: none;
    border-radius: 0;
}

@media (max-width: 1000px) {
    .modal-backdrop {
        padding: 100px 24px 48px;
    }

    .modal-contact {
        top: 24px;
        right: 24px;
    }

    .modal-panel {
        padding: 70px 48px 56px;
    }

    .modal-close {
        top: 20px;
        right: 24px;
    }

    .cs-section-title,
    .cs-section > .cs-body,
    .cs-problems,
    .cs-section > .cs-figure,
    .cs-section > .cs-callout {
        margin-left: 0;
        margin-right: 0;
    }

    .cs-goals-constraints {
        gap: 24px;
    }

    .cs-design-comparison {
        grid-template-columns: minmax(0, 1fr) 32px minmax(0, 1fr);
        column-gap: 16px;
    }

    .cs-comparison-arrow svg {
        width: 32px;
    }
}

@media (max-width: 720px) {
    .modal-backdrop {
        padding: 76px 12px 24px;
    }

    .modal-contact {
        top: 16px;
        right: 16px;
        font-size: 16px;
    }

    .modal-panel {
        padding: 64px 20px 36px;
        border-radius: 16px;
    }

    .modal-close {
        top: 14px;
        right: 16px;
    }

    .cs-title {
        font-size: clamp(32px, 9vw, 48px);
        line-height: 1.15;
    }

    .cs-meta {
        margin-bottom: 32px;
    }

    .cs-section {
        margin-bottom: 48px;
    }

    .cs-section-title,
    .cs-card h3 {
        font-size: clamp(26px, 6vw, 34px);
        line-height: 1.25;
    }

    .cs-body,
    .cs-problem-item p,
    .cs-card li,
    .cs-card p {
        font-size: 16px;
    }

    .cs-card {
        padding: 24px 28px;
    }

    .cs-card h3 {
        text-align: left;
    }

    .cs-card ul {
        padding-left: 1.2em;
    }

    .cs-callout {
        gap: 16px;
        padding: 20px;
    }

    .cs-cover-phones {
        width: 100%;
    }

    .cs-design-comparison {
        grid-template-columns: minmax(0, 1fr);
        align-items: stretch;
        gap: 16px;
    }

    .cs-design-before {
        grid-column: 1;
        grid-row: 1;
    }

    .cs-comparison-arrow {
        grid-column: 1;
        grid-row: 2;
        min-width: 0;
        min-height: 32px;
    }

    .cs-comparison-arrow svg {
        transform: rotate(90deg);
    }

    .cs-design-after img {
        grid-column: 1;
        grid-row: 3;
    }

    .cs-design-after .cs-caption {
        grid-column: 1;
        grid-row: 4;
        margin-top: 0;
    }

    .cs-goals-constraints {
        flex-direction: column;
    }

    .cs-problem-icon {
        width: 44px;
        height: 44px;
    }

    .cs-problem-item {
        gap: 18px;
    }

    .cs-caption-right {
        text-align: left;
    }
}

@media (max-width: 1250px) {
    .cs-doodle {
        display: none;
    }
}
