/* Shared editorial case-study layouts. Global tokens, fonts, and navigation live in style.css. */
.case-page {
    color: var(--ink);
    background: var(--canvas);
}

.case-hero {
    padding-top: clamp(44px, 7vw, 100px);
}
.case-hero-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}
.case-category {
    margin-top: clamp(48px, 7vw, 100px);
    color: var(--muted);
}
.case-title-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr);
    align-items: end;
    gap: 56px;
    margin-top: 18px;
}
.case-title-grid h1 {
    font-size: clamp(54px, 7.7vw, 112px);
    font-weight: 500;
    line-height: 0.98;
    letter-spacing: -0.065em;
    text-wrap: balance;
}
.case-hero--long .case-title-grid h1 {
    font-size: clamp(44px, 6.1vw, 88px);
}
.case-summary {
    max-width: 34ch;
    font-size: clamp(17px, 1.4vw, 20px);
    line-height: 1.55;
    color: var(--muted);
    text-wrap: pretty;
}
.case-overview {
    display: grid;
    grid-template-columns: 0.7fr 1.25fr 1.25fr;
    gap: 32px;
    padding: 26px 0;
    margin-top: 48px;
    border-top: 1px solid var(--line);
}
.case-overview dt {
    font-family: var(--font-mono, 'Fragment Mono', monospace);
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 8px;
}
.case-overview dd {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}
.case-cover {
    overflow: hidden;
    background: #e8ebef;
    border-radius: 4px;
}
.case-cover > img {
    display: block;
    width: 100%;
    height: auto;
}
.case-cover--icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 460px;
    background: #edf0f0;
    padding: 64px;
}
.case-cover--icon > img {
    width: min(320px, 100%);
    border-radius: 32px;
}
.case-cover--chart {
    padding: clamp(20px, 4vw, 64px);
    background: #e9edf4;
}
.case-cover--chart > img {
    background: #fff;
    border: 1px solid #e1e5ed;
}
.case-cover--phones {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: clamp(20px, 4vw, 56px);
    padding: clamp(28px, 5vw, 64px) clamp(24px, 6vw, 80px);
    background: #e9ece6;
    max-height: 640px;
}
.case-cover--phones > img {
    width: min(25%, 240px);
    height: auto;
    border-radius: 14px;
    border: 1px solid #d0d6ca;
}
.case-cover--phones > img:nth-child(2) {
    margin-top: 36px;
}

.project-details {
    display: grid;
    grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
    gap: clamp(40px, 7vw, 96px);
    padding-top: clamp(56px, 7vw, 104px);
    padding-bottom: 40px;
}
.meta-sidebar {
    position: sticky;
    top: 112px;
    align-self: start;
}
.case-tools {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 8px 16px;
    padding: 16px 0 28px;
}
.case-tools li {
    font-size: 13px;
    line-height: 1.5;
    color: var(--muted);
}
.case-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.case-links .button {
    justify-content: space-between;
    font-size: 13px;
    padding-inline: 16px;
}
.case-contents {
    margin-top: 36px;
    border-top: 1px solid var(--line);
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.case-contents .eyebrow {
    margin-bottom: 4px;
}
.case-contents a {
    font-size: 12px;
    line-height: 1.45;
    color: var(--muted);
    transition: color var(--duration-default) var(--ease);
}
.case-contents a:hover {
    color: var(--accent);
}
.content-main {
    min-width: 0;
}
.description-group {
    margin-bottom: clamp(48px, 6vw, 80px);
    scroll-margin-top: 112px;
}
.description-group:last-child {
    margin-bottom: 0;
}
.section-label {
    display: block;
    margin-bottom: 16px;
    color: var(--muted);
    font-family: var(--font-mono, 'Fragment Mono', monospace);
    font-size: 10px;
    line-height: 1.5;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.description-group h2 {
    font-size: clamp(28px, 3vw, 42px);
    font-weight: 500;
    letter-spacing: -0.045em;
    line-height: 1.15;
    margin-bottom: 24px;
    max-width: 28ch;
    text-wrap: balance;
}
.description-group p {
    font-size: 16px;
    line-height: 1.75;
    color: var(--muted);
    margin-bottom: 20px;
    max-width: 68ch;
    text-wrap: pretty;
}
.description-group p:last-child {
    margin-bottom: 0;
}
.description-group strong {
    font-weight: 600;
    color: var(--ink);
}
.description-group ul {
    padding-left: 20px;
    font-size: 15px;
    line-height: 1.75;
    color: var(--muted);
}
.description-group li {
    padding-left: 4px;
    margin-bottom: 8px;
}
.project-image-full {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 56px;
    border-radius: 3px;
}
.project-logo {
    display: block;
    width: 160px;
    height: auto;
    margin: 0 0 48px;
    border-radius: 3px;
}
.feature-grid,
.tech-grid,
.role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 32px;
    margin-top: 32px;
}
.feature-card,
.tech-card,
.role-card {
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.feature-card h3,
.tech-card h3,
.member-name {
    font-size: 17px;
    font-weight: 500;
    line-height: 1.4;
    letter-spacing: -0.02em;
    margin-bottom: 10px;
}
.feature-card p,
.tech-card p {
    font-size: 14px;
    line-height: 1.65;
}
.member-role {
    font-family: var(--font-mono, 'Fragment Mono', monospace);
    font-size: 10px;
    line-height: 1.6;
    color: var(--muted);
    margin-bottom: 14px;
}
.role-card ul {
    font-size: 13px;
}
.project-gallery {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    gap: 24px;
    margin-top: 32px;
}
.project-gallery .project-image-full {
    grid-column: 1 / -1;
    margin-bottom: 0;
}
.gallery-image {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px;
    border: 1px solid #e1e4e9;
}
.phone-gallery {
    gap: 40px;
    padding: 28px;
    background: #edf0eb;
}
.phone-gallery img {
    border-radius: 9px;
}
.phone-detail {
    display: block;
    width: min(100%, 320px);
    height: auto;
    margin: 32px auto;
    border: 1px solid var(--line);
    border-radius: 8px;
}
.demo-preview {
    background: #101114;
    padding: 24px;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}
.demo-preview .gallery-image {
    border: 0;
    width: 100%;
    aspect-ratio: 800 / 730;
    object-fit: contain;
}
.demo-preview .button {
    background: #fff;
    color: var(--ink);
    border-color: #fff;
}
.demo-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.demo-card > span {
    font-family: var(--font-mono, 'Fragment Mono', monospace);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.demo-card > strong {
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.2;
    margin: 12px 0 16px;
}
.demo-card > a {
    align-self: flex-start;
    margin-top: 12px;
    padding-block: 10px;
    border-bottom: 1px solid currentColor;
    font-size: 14px;
    color: var(--accent);
}
.video-wrapper {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
    background: #e8ebef;
}
.video-wrapper iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}
.improvement-list {
    list-style: none;
    padding-left: 0 !important;
}
.improvement-list li {
    display: grid;
    grid-template-columns: 100px minmax(0, 1fr);
    gap: 10px 24px;
    padding: 24px 0;
    margin: 0;
    border-top: 1px solid var(--line);
}
.imp-label {
    grid-row: span 2;
    font-family: var(--font-mono, 'Fragment Mono', monospace);
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.imp-title {
    color: var(--ink);
    font-size: 17px;
    font-weight: 500;
    line-height: 1.4;
}
.imp-desc {
    font-size: 14px;
    line-height: 1.65;
}
.table-scroll {
    overflow-x: auto;
    overscroll-behavior-x: contain;
    border-top: 1px solid var(--line);
}
.test-table {
    width: 100%;
    min-width: 520px;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.5;
    text-align: left;
}
.test-table caption {
    text-align: left;
    padding: 20px 12px;
    color: var(--muted);
    font-family: var(--font-mono, 'Fragment Mono', monospace);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.test-table th,
.test-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}
.test-table th {
    font-weight: 500;
}
.test-table td {
    color: var(--muted);
}
.status-pass {
    color: #23613b;
    font-weight: 500;
}
.project-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px;
    padding-top: 80px;
    padding-bottom: 80px;
}
.project-pagination-link {
    border-top: 1px solid var(--line);
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.project-pagination-link--next {
    text-align: right;
}
.pagination-title {
    font-size: clamp(24px, 2.5vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.04em;
    transition: color var(--duration-default) var(--ease);
    text-wrap: balance;
}
.project-pagination-link:hover .pagination-title {
    color: var(--accent);
}
.case-footer {
    padding-top: 56px;
    padding-bottom: 28px;
    border-top: 1px solid var(--line);
}
.case-contact-link {
    display: inline-flex;
    align-items: baseline;
    gap: 24px;
    font-size: clamp(56px, 7vw, 96px);
    font-weight: 500;
    line-height: 1.15;
    letter-spacing: -0.06em;
    margin-top: 16px;
    transition: color var(--duration-default) var(--ease);
}
.case-contact-link:hover {
    color: var(--accent);
}
.case-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    margin-top: 56px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
    font-size: 11px;
    color: var(--muted);
}
.case-socials {
    display: flex;
    gap: 24px;
}
.case-socials a {
    padding-block: 12px;
    transition: color var(--duration-default) var(--ease);
}
.case-socials a:hover {
    color: var(--accent);
}

@media (max-width: 1000px) {
    .case-title-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }
    .case-summary {
        max-width: 56ch;
    }
    .project-details {
        grid-template-columns: minmax(160px, 200px) minmax(0, 1fr);
        gap: 40px;
    }
    .case-overview {
        gap: 24px;
    }
    .feature-grid,
    .tech-grid,
    .role-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .case-footer-bottom {
        flex-wrap: wrap;
    }
}

@media (max-width: 700px) {
    .case-hero {
        padding-top: 32px;
    }
    .case-category {
        margin-top: 52px;
    }
    .case-title-grid {
        gap: 24px;
    }
    .case-title-grid h1 {
        font-size: clamp(44px, 11vw, 76px);
        letter-spacing: -0.055em;
    }
    .case-summary {
        font-size: 17px;
        line-height: 1.55;
    }
    .case-overview {
        grid-template-columns: 1fr 1.4fr;
        margin-top: 32px;
        padding-block: 22px;
    }
    .case-overview > div:last-child {
        grid-column: 1 / -1;
    }
    .case-overview dd {
        margin: 0;
        font-size: 13px;
    }
    .case-cover--icon {
        min-height: 300px;
        padding: 40px;
    }
    .case-cover--icon > img {
        width: 200px;
        border-radius: 24px;
    }
    .case-cover--phones {
        gap: 16px;
        max-height: 460px;
        padding: 28px 22px;
    }
    .case-cover--phones > img {
        width: 43%;
        border-radius: 9px;
    }
    .case-cover--phones > img:last-child {
        display: none;
    }
    .case-cover--phones > img:nth-child(2) {
        margin-top: 20px;
    }
    .project-details {
        grid-template-columns: 1fr;
        gap: 48px;
        padding-top: 48px;
    }
    .meta-sidebar {
        position: static;
        padding-bottom: 32px;
        border-bottom: 1px solid var(--line);
    }
    .case-tools {
        padding-bottom: 20px;
    }
    .case-links {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .case-links .button {
        gap: 16px;
        flex-grow: 1;
    }
    .case-contents {
        display: none;
    }
    .description-group h2 {
        font-size: 30px;
        max-width: 26ch;
    }
    .description-group p {
        font-size: 16px;
        line-height: 1.7;
    }
    .feature-grid,
    .tech-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 20px;
    }
    .feature-card h3,
    .tech-card h3 {
        font-size: 16px;
    }
    .feature-card p,
    .tech-card p {
        font-size: 13px;
    }
    .role-grid {
        grid-template-columns: 1fr;
    }
    .project-gallery {
        gap: 16px;
    }
    .phone-gallery {
        padding: 20px;
        gap: 20px;
    }
    .demo-preview {
        padding: 16px;
    }
    .project-gallery:has(.demo-preview) {
        grid-template-columns: 1fr;
    }
    .improvement-list li {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .imp-label {
        grid-row: auto;
    }
    .project-pagination {
        gap: 20px;
        padding-top: 32px;
        padding-bottom: 48px;
    }
    .pagination-title {
        font-size: 24px;
    }
    .project-pagination-link .eyebrow {
        font-size: 9px;
    }
    .case-footer {
        padding-top: 40px;
    }
    .case-contact-link {
        font-size: 58px;
    }
    .case-footer-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
        margin-top: 32px;
    }
    .case-socials {
        flex-wrap: wrap;
        gap: 24px;
    }
}

@media (max-width: 380px) {
    .feature-grid,
    .tech-grid,
    .project-gallery:not(.phone-gallery) {
        grid-template-columns: 1fr;
    }
    .case-overview {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .case-overview > div:last-child {
        grid-column: auto;
    }
    .case-links {
        flex-direction: column;
    }
}

@media (prefers-reduced-motion: reduce) {
    .case-page *,
    .case-page *::before,
    .case-page *::after {
        animation: none !important;
        transition: none !important;
    }
}

.gallery-item {
    display: block;
    min-width: 0;
}
.gallery-item--wide {
    grid-column: 1 / -1;
}
.gallery-item figure {
    margin: 0;
}
.gallery-item figcaption {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 10px;
    color: var(--muted);
    font-family: var(--font-mono, 'Fragment Mono', monospace);
    font-size: 9px;
    line-height: 1.5;
    letter-spacing: 0.04em;
}
.gallery-item:hover figcaption {
    color: var(--accent);
}
.chart-gallery {
    grid-template-columns: 1fr;
    gap: 32px;
}
