/* Identity reflows content instead of shrinking an entire desktop canvas. */
html:has(#page-about-intro.identity-vertical-page) {
    --identity-safe-top: calc(var(--identity-header-h, 90px) + 76px);
    --identity-safe-bottom: calc(100px + env(safe-area-inset-bottom, 0px));
    scroll-padding-top: var(--identity-safe-top);
    scroll-padding-bottom: var(--identity-safe-bottom);
}
html body #page-about-intro.identity-vertical-page > :is(#about-sec-who, #business-sec-main, #team-sec-roles, #rnd-sec-cert, #history-sec-timeline) {
    min-height: 100svh !important;
    padding-top: calc(var(--identity-safe-top) + 16px) !important;
    padding-bottom: calc(var(--identity-safe-bottom) + 16px) !important;
    gap: clamp(28px, 4vw, 48px) !important;
}
/* Fade content toward the fixed controls instead of cutting it off abruptly. */
html body #page-about-intro.identity-vertical-page .identity-safe-content {
    --identity-edge-fade: clamp(28px, 5vh, 64px);
    --identity-edge-mask: linear-gradient(to bottom,
        transparent calc(var(--identity-clip-top, -10000px) - var(--identity-edge-fade)),
        #000 var(--identity-clip-top, -10000px),
        #000 calc(100% - var(--identity-clip-bottom, -10000px)),
        transparent calc(100% - var(--identity-clip-bottom, -10000px) + var(--identity-edge-fade)));
    clip-path: none !important;
    -webkit-mask-image: var(--identity-edge-mask);
    mask-image: var(--identity-edge-mask);
    -webkit-mask-size: calc(100% + 200vw) 100%;
    mask-size: calc(100% + 200vw) 100%;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-clip: no-clip;
    mask-clip: no-clip;
}
html body #page-about-intro.identity-vertical-page :is(#about-sec-who, #business-sec-main, #team-sec-roles, #rnd-sec-cert, #history-sec-timeline) .business-title-small {
    font-size: clamp(32px, 4.2vw, 60px) !important;
    line-height: 1.2 !important;
    margin: 0 !important;
}
html body #page-about-intro.identity-vertical-page #about-sec-who .intro-text-description p,
html body #page-about-intro.identity-vertical-page #about-sec-who .intro-text-description p strong {
    font-size: clamp(16px, 1.4vw, 22px) !important;
    line-height: 1.75 !important;
}
html body #page-about-intro.identity-vertical-page #about-sec-who .intro-text-title h3 {
    font-size: clamp(28px, 2.8vw, 44px) !important;
    line-height: 1.45 !important;
}
html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-image img {
    object-fit: contain;
}
/* Keep the 6px hover lift inside the masked wrapper's paint bounds.
   Negative margins preserve the existing card positions and section height. */
html body #page-about-intro.identity-vertical-page #team-sec-roles > .team-profiles-content {
    padding-block: 12px !important;
    margin-block: -12px !important;
}
@media (min-width: 1401px) {
    /* Leave paint space for lifted cards and their glow inside the fade mask.
       Balance padding with margins to preserve the existing card layout. */
    html body #page-about-intro.identity-vertical-page #business-sec-main > .sub-content {
        padding-block: calc(var(--business-scale-space, 24px) + 32px) !important;
        margin-block: -32px !important;
    }
}
html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profiles-grid {
    max-width: 1240px;
}
html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-description {
    font-size: 16px;
}
html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-name-en {
    font-size: 12px;
}
html body #page-about-intro.identity-vertical-page #team-sec-roles .team-section-hint {
    font-size: 20px !important;
}

/* R&D text and the certificate keep independent, readable natural sizes. */
html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-content-row {
    display: grid !important;
    grid-template-columns: minmax(240px, .7fr) minmax(0, 1.5fr) !important;
    gap: clamp(28px, 4vw, 64px) !important;
    width: 100% !important;
    max-width: 1200px !important;
    align-items: center !important;
}
html body #page-about-intro.identity-vertical-page #rnd-sec-cert :is(.rnd-img-mobile-top, .rnd-text-wrapper) {
    position: relative !important;
    inset: auto !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    height: auto !important;
    max-height: none !important;
    padding: 0 !important;
    margin: 0 !important;
    transform: none !important;
}
html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-img-wrapper {
    width: min(100%, 340px) !important;
    max-width: 340px !important;
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 595 / 841 !important;
    margin-inline: auto !important;
}
html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-img-mobile-top > span {
    font-size: 14px !important;
    line-height: 1.5 !important;
}
html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-heading {
    font-size: clamp(24px, 2.1vw, 34px) !important;
    line-height: 1.5 !important;
    white-space: normal !important;
}
html body #page-about-intro.identity-vertical-page #rnd-sec-cert :is(.rnd-text-description, .rnd-text-description strong) {
    font-size: clamp(16px, 1.4vw, 22px) !important;
    line-height: 1.75 !important;
    word-break: keep-all;
    overflow-wrap: anywhere;
}
html body #page-about-intro.identity-vertical-page #history-sec-timeline {
    --history-event-font-size: clamp(16px, 1.4vw, 22px);
    --history-event-row-h: 56px;
}
html body #page-about-intro.identity-vertical-page #history-sec-timeline :is(.history-timeline-shell, .history-event-panels) {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
}
html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-event-row {
    padding-block: 8px;
}

/* Tablet and phone layouts retain portrait photos and full-size copy. */
@media (max-width: 1400px) {
    html body #page-about-intro.identity-vertical-page > :is(#about-sec-who, #business-sec-main, #team-sec-roles, #rnd-sec-cert, #history-sec-timeline) {
        padding-inline: clamp(20px, 4vw, 48px) !important;
    }
    html body #page-about-intro.identity-vertical-page #about-sec-who > .content-wrapper {
        display: none !important;
    }
    html body #page-about-intro.identity-vertical-page #about-sec-who > .about-mobile-stack {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: clamp(32px, 5vw, 56px) !important;
        width: 100% !important;
        max-width: 760px !important;
        text-align: center;
    }
    html body #page-about-intro.identity-vertical-page #about-sec-who :is(.about-mobile-promise, .about-mobile-description) {
        width: 100% !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        margin: 0 !important;
    }
    html body #page-about-intro.identity-vertical-page #about-sec-who .about-mobile-promise h3 {
        font-size: clamp(24px, 3.6vw, 36px) !important;
        line-height: 1.5 !important;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main > .sub-content {
        padding: 0 !important;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-list {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        width: 100% !important;
        max-width: 1100px !important;
        margin: 0 auto !important;
        gap: 20px !important;
        scale: none;
        zoom: 1;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box {
        --business-copy-offset: 24px;
        grid-row: auto;
        grid-template-rows: 72px 50px minmax(72px, 1fr) 22px !important;
        gap: 10px !important;
        min-height: 360px !important;
        aspect-ratio: .82 !important;
        padding: 24px !important;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box-icon {
        width: 72px;
        height: 72px;
        margin: 0;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box .service-box-title {
        font-size: 20px !important;
        line-height: 1.25 !important;
        word-break: keep-all;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box .service-box-desc {
        font-size: 16px !important;
        line-height: 1.5 !important;
        min-height: 0 !important;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box .service-box-more {
        font-size: 14px;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profiles-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        max-width: 1000px;
        gap: 20px;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile {
        grid-column: auto;
        grid-row: auto;
        min-height: 0;
        height: auto;
        aspect-ratio: 15 / 17;
        padding: 20px;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-lead {
        grid-column: 1 / -1;
        justify-self: center;
        width: min(100%, 340px);
        aspect-ratio: 15 / 22;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-name {
        font-size: 24px;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-section-hint {
        font-size: 18px !important;
        line-height: 1.6;
        word-break: keep-all;
    }
}
@media (max-width: 999px) {
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-list,
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profiles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        max-width: 720px;
    }
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-content-row {
        grid-template-columns: minmax(0, 1fr) !important;
        max-width: 720px !important;
    }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-timeline-shell {
        display: flex;
        flex-direction: column;
        width: min(100%, 720px);
        gap: 28px;
    }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-year-tabs {
        flex-direction: row;
        justify-content: center;
        gap: clamp(20px, 5vw, 40px);
        padding-top: 0;
    }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-year-tab {
        width: auto;
        font-size: clamp(28px, 5vw, 40px);
        line-height: 1.2;
    }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-event-panels {
        width: 100%;
        max-width: 100%;
    }
}
@media (max-width: 599px) {
    html:has(#page-about-intro.identity-vertical-page) {
        --identity-safe-top: calc(var(--identity-header-h, 70px) + 64px);
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-list,
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profiles-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        max-width: 340px !important;
        margin-inline: auto;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box {
        min-height: 340px !important;
        aspect-ratio: .82 !important;
    }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-event-row {
        column-gap: 12px;
    }
}
@media (max-height: 600px) {
    html:has(#page-about-intro.identity-vertical-page) {
        --identity-safe-top: calc(var(--identity-header-h, 70px) + 48px);
        --identity-safe-bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    }
    html body #page-about-intro .identity-section-counter {
        top: calc(var(--identity-header-h, 70px) + 8px);
        font-size: 18px;
    }
    html body:has(#page-about-intro.identity-vertical-page) #scroll-hint-overlay {
        bottom: calc(18px + env(safe-area-inset-bottom, 0px)) !important;
        font-size: 12px;
    }
}

/* Tablet typography follows available width, never the viewport's short edge. */
@media (min-width: 600px) and (max-width: 1400px) {
    html body #page-about-intro.identity-vertical-page :is(#about-sec-who, #business-sec-main, #team-sec-roles, #rnd-sec-cert, #history-sec-timeline) .business-title-small {
        font-size: clamp(44px, 5.2vw, 64px) !important;
    }
    html body #page-about-intro.identity-vertical-page #about-sec-who .about-mobile-promise h3 {
        font-size: clamp(32px, 4.2vw, 46px) !important;
        line-height: 1.45 !important;
    }
    html body #page-about-intro.identity-vertical-page #about-sec-who :is(.intro-text-description p, .intro-text-description p strong),
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert :is(.rnd-text-description, .rnd-text-description strong) {
        font-size: clamp(20px, 2.15vw, 24px) !important;
        line-height: 1.7 !important;
    }
    html body #page-about-intro.identity-vertical-page #about-sec-who > .about-mobile-stack {
        max-width: 960px !important;
        gap: clamp(32px, 4vw, 48px) !important;
    }
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-heading {
        font-size: clamp(28px, 3.1vw, 38px) !important;
        line-height: 1.5 !important;
    }
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-img-mobile-top > span {
        font-size: 18px !important;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-list {
        max-width: 1160px !important;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box {
        grid-template-rows: 80px minmax(60px, auto) minmax(90px, 1fr) 24px !important;
        min-height: 432px !important;
    }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box-icon { width: 80px; height: 80px; }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box .service-box-title { font-size: 24px !important; }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box .service-box-desc { font-size: 18px !important; }
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-box .service-box-more { font-size: 16px; }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-section-hint { font-size: 22px !important; }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-name { font-size: 28px; }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-name-en { font-size: 14px; }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-description { font-size: 18px; }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline {
        --history-event-font-size: clamp(20px, 2.15vw, 24px);
        --history-event-row-h: 72px;
    }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-timeline-shell { width: min(100%, 1080px); }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-event-panels { max-width: none; }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-year-tab {
        font-size: clamp(38px, 4.4vw, 56px);
        line-height: 1.15;
    }
}
/* Portrait tablets use the height for readable content rather than empty margins. */
@media (min-width: 600px) and (max-width: 1400px) and (orientation: portrait) {
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        max-width: 900px !important;
    }
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-content-row {
        grid-template-columns: minmax(0, 1fr) !important;
        max-width: 900px !important;
        gap: 32px !important;
    }
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-img-wrapper {
        width: clamp(260px, 28vw, 340px) !important;
        max-width: 100% !important;
    }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-timeline-shell {
        display: flex;
        flex-direction: column;
        width: min(100%, 940px);
        gap: 36px;
    }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-year-tabs {
        flex-direction: row;
        justify-content: center;
        gap: 40px;
        padding-top: 0;
    }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-year-tab { width: auto; }
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-event-panels { width: 100%; }
}
html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-heading :is(.rnd-emphasis-fill, .rnd-emphasis-base, .rnd-emphasis-overlay) {
    font-size: inherit !important;
    line-height: inherit !important;
}
html body #page-about-intro.identity-vertical-page #rnd-image-modal {
    z-index: 400000 !important;
}
@media (min-width: 600px) and (max-width: 699px) {
    html body #page-about-intro.identity-vertical-page #business-sec-main .service-list,
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profiles-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        max-width: 420px !important;
    }
}

/* Tablet profiles read across two columns, including the lead profile. */
@media (min-width: 600px) and (max-width: 1400px) {
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profiles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        max-width: 800px !important;
        margin-inline: auto;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-lead {
        grid-column: auto;
        grid-row: auto;
        justify-self: stretch;
        width: 100%;
        aspect-ratio: 15 / 17;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-lead .team-profile-image img {
        object-fit: cover;
        object-position: center top;
    }
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-content-row {
        grid-template-columns: minmax(0, 1fr) !important;
        max-width: 900px !important;
        margin-inline: auto;
        gap: 32px !important;
    }
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-heading {
        font-size: clamp(24px, 3.1vw, 38px) !important;
        white-space: nowrap !important;
    }
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-heading > br {
        display: block !important;
    }
}
@media (max-width: 1400px) {
    html body #page-about-intro.identity-vertical-page #history-sec-timeline .history-event-panels {
        width: max-content;
        max-width: 100%;
        margin-inline: auto;
        text-align: left;
    }
    /* Retain the desktop's authored line breaks, with natural wrapping on phones. */
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert :is(.rnd-heading, .rnd-text-description) > br {
        display: inline !important;
    }
}

/* Authored phone breaks leave tablet and desktop copy unchanged. */
html body #page-about-intro.identity-vertical-page :is(#about-sec-who, #team-sec-roles, #rnd-sec-cert) br.identity-phone-break {
    display: none !important;
}
@media (max-width: 599px) {
    html body #page-about-intro.identity-vertical-page :is(#about-sec-who, #team-sec-roles, #rnd-sec-cert) br.identity-phone-break {
        display: inline !important;
    }
    html body #page-about-intro.identity-vertical-page #rnd-sec-cert .rnd-heading {
        text-align: left !important;
        width: 100%;
    }
}

/* Phone team grid: retain type sizes and let expanded copy determine height. */
@media (max-width: 599px) {
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profiles-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        max-width: none !important;
        gap: 12px;
        align-items: stretch;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile {
        grid-column: auto;
        grid-row: auto;
        justify-self: stretch;
        width: 100%;
        height: auto;
        min-height: clamp(240px, 65vw, 340px);
        aspect-ratio: auto;
        padding: 12px;
        border-radius: 12px;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-copy {
        min-width: 0;
        width: 100%;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-name {
        white-space: normal;
        word-break: keep-all;
        overflow-wrap: anywhere;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-name-en {
        white-space: normal;
        overflow-wrap: anywhere;
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-description br {display:none}
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-image::after {
        background:linear-gradient(to bottom,transparent 20%,rgba(0,0,0,.25) 45%,rgba(0,0,0,.88) 100%);
    }
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile.is-role-visible {translate:none}
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile:nth-child(1) {--team-reveal-order:0!important}
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile:nth-child(2) {--team-reveal-order:1!important}
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile:nth-child(3) {--team-reveal-order:2!important}
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile:nth-child(4) {--team-reveal-order:3!important}
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile:nth-child(5) {--team-reveal-order:4!important}
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile:nth-child(6) {--team-reveal-order:5!important}
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile:nth-child(7) {--team-reveal-order:6!important}
}

/* Fill mobile cards with proportional crops instead of letterboxing. */
@media (max-width: 768px) {
    html body #page-about-intro.identity-vertical-page #team-sec-roles .team-profile-image img {
        object-fit: cover;
        object-position: center top;
    }
}
